Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2024 in all areas

  1. Here is a very simple example using the method described earlier by argumentum. Note the use of static variables. Doing it that way prevents the need to define those variables as Global. The example script sets up Ctrl+w and Ctrl+j as hotkeys to show how the method can be used for multiple hotkeys. The payload in each hotkey function will only execute if the hotkey is fired twice within the specified time, which in this case is 500 milliseconds (.5 seconds). Press ESC to exit the example. #include <Constants.au3> #include <Misc.au3> ;Declare constants Const $DOUBLE_CLICK_TIME = 500 ;Declare global vars Global $ghUserDll = DllOpen("user32.dll"), _ $ghCtrlWTimer = TimerInit(), _ $ghCtrlJTimer = TimerInit() ;Set hotkey(s) HotKeySet("^w", do_ctrl_w) HotKeySet("^j", do_ctrl_j) ;Loop until ESC pressed While 1 If _IsPressed("1B", $ghUserDll) then ExitLoop WEnd ;========================================================================== ; These hotkey functions only do something if called twice within a ; specified time ($DOUBLE_CLICK_TIME) ;========================================================================== Func do_ctrl_w() ;Declare vars Static $iPrevTime = 0 Local $iCurrTime = TimerDiff($ghCtrlWTimer) ;If function called twice within specified time If $iCurrTime < ($iPrevTime + $DOUBLE_CLICK_TIME) Then ;Do something MsgBox($MB_ICONINFORMATION, "INFO", "CTRL+W double click occurred.") ;Reset timer $ghCtrlWTimer = TimerInit() EndIf ;Reset previous Time to current time $iPrevTime = TimerDiff($ghCtrlWTimer) EndFunc Func do_ctrl_j() ;Declare vars Static $iPrevTime = 0 Local $iCurrTime = TimerDiff($ghCtrlJTimer) ;If function called twice within specified time If $iCurrTime < ($iPrevTime + $DOUBLE_CLICK_TIME) Then ;Do something MsgBox($MB_ICONINFORMATION, "INFO", "CTRL+J double click occurred.") ;Reset timer $ghCtrlJTimer = TimerInit() EndIf ;Reset previous Time to current time $iPrevTime = TimerDiff($ghCtrlJTimer) EndFunc
    4 points
  2. Celebrating one thousand downloads of the bundle.
    2 points
  3. .. if to keep for later, run _SQLite_Display2DResult() and save to a text file. Or use _ArrayToString() and save it to a file that you can load and read back to array with _ArrayFromString(). And the file name could be: timestamp + @ScriptLineNumber .txt If you make a log file, point to each "array.txt" file you made. The above is because am not sure if you using this for coding or debugging.
    1 point
  4. What do you mean by "the old _WD_Option('Port', 9515)"? Of course you need both lines. The port option and the DriverParams option, see wd_demo here. It's not new, the only change is that you also have to add the port in the DriverParams statement. Best regards Sven
    1 point
  5. Those are 2 different things. One is the database query that you sanitize before making the query. The other is GUICtrlRead($idCtrlInput) that you'd make sure can not brake the query ( sanitize ) is not complicated. But you don't try the examples in the help file because to you knowledge is something, magical ?, I guess ? Copy the help file's examples of GUICtrlCreateInput() and you'll know how to use the control. Copy the help file's examples of SQLite and you'll know hoe to do that to. Then, start coding
    1 point
  6. Me neither A couple of days ago, before finding Jon's code, I thought maybe WinKill was sending a WM_DESTROY message. But when I tried to send a WM_DESTROY message (instead of WinKill) the results were not good at all, then came this french link which indicated why it was a wrong way (translation in English below) Edit: msdn link : "Here is a flow chart showing the typical way to process WM_CLOSE and WM_DESTROY messages" :
    1 point
  7. "// Use more force - Mwuahaha" So one is WinClose and the other KillTheProcessForTheWindow, interesting. I never knew. Thanks for posting.
    1 point
  8. I've ported some of the JavaScript 140 Bytes demos from dwitter.net to FreeBasic. Download AiO with 1000 examples (7-Zip archive): The beauty - magic of math Vol. 1 - 23 build 2024-01-14.7z (5.09 mb with source code and Windows x64 compiled executables) or have a look to my 1drive folder: _dwitter.net Some screenshots: ... Autoit is too slow for almost all of these examples. Happy watching.
    1 point
  9. Updated to version The beauty - magic of math Vol. 1 - 23 build 2024-01-14. See 1st post for download details.
    1 point
  10. Something like this here? #include <GDIPlus.au3> #include <Clipboard.au3> _GDIPlus_Startup() Global $hMemoryBMP = 0, $hBmp, $hWnd = WinGetHandle(AutoItWinGetTitle()) HotKeySet("+!q", "_Exit") ;Shift+Alt+q to exit _ClipBoard_Open($hWnd) _ClipBoard_Empty() _ClipBoard_Close() Sleep(100) Do If Not _ClipBoard_Open($hWnd) Then ConsoleWrite("Could not open clipboard!!!" & @CRLF) _Exit() EndIf $hMemoryBMP = _ClipBoard_GetDataEx($CF_BITMAP) If $hMemoryBMP Then $sFile = FileSaveDialog("Save Bitmap from Clipboard", "", "Images(*.jpg;*.bmp;*.png;*.gif)") If @error Then ContinueLoop $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hMemoryBMP) If _GDIPlus_ImageSaveToFile($hBmp, $sFile) Then ConsoleWrite("Image was saved properly!" & @CRLF) Else ConsoleWrite("Image could not be saved!" & @CRLF) Endif _GDIPlus_ImageDispose($hBmp) _ClipBoard_Empty() $hMemoryBMP = 0 EndIf _ClipBoard_Close() Until False * Sleep(500) Func _Exit() ConsoleWrite("Finished!" & @CRLF) _GDIPlus_Shutdown() Exit EndFunc Press Shift+Alt+q to exit.
    1 point
×
×
  • Create New...