JonnyThunder Posted July 26, 2008 Share Posted July 26, 2008 Hello, As per the title - is there a way to detect a double-click on a text box?? Or even, create a context menu for a text box?? Thanks, JT Link to comment Share on other sites More sharing options...
Kiti Posted July 26, 2008 Share Posted July 26, 2008 Look in the helpfile for _Timer_Init() and Ispressed(). You should check if the mouse clicks two times, measure the time between the clicks, and if the time is smaller than x miliseconds, then that's a double click. Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
JonnyThunder Posted July 26, 2008 Author Share Posted July 26, 2008 Is this really the only way it can be done? Are there no event handlers or anything for double clicks on a form field? Link to comment Share on other sites More sharing options...
rasim Posted July 26, 2008 Share Posted July 26, 2008 JonnyThunder Is this really the only way it can be done?Example with subclassing control: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> Global Const $WM_LBUTTONDBLCLK = 0x203 $hGUI = GUICreate("Test GUI", 300, 200) $edit = GUICtrlCreateEdit("", 10, 10, 280, 180) $wProcHandle = DllCallbackRegister("_WindowProc", "ptr", "hwnd;uint;wparam;lparam") $wProcOld = _WinAPI_SetWindowLong(GUICtrlGetHandle($edit), $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle)) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGui) DllCallbackFree($wProcHandle) Func _WindowProc($hWnd, $Msg, $wParam, $lParam) Switch $hWnd Case GUICtrlGetHandle($edit) Switch $Msg Case $WM_LBUTTONDBLCLK ConsoleWrite("-> Left mouse double click" & @LF) Return 0 EndSwitch EndSwitch Local $aRet = DllCall("user32.dll", "int", "CallWindowProc", "ptr", $wProcOld, _ "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam) Return $aRet[0] EndFunc Link to comment Share on other sites More sharing options...
JonnyThunder Posted July 26, 2008 Author Share Posted July 26, 2008 Wow - thats just the example im looking for! Many thanks for your post. Link to comment Share on other sites More sharing options...
martin Posted July 26, 2008 Share Posted July 26, 2008 Wow - thats just the example im looking for!Many thanks for your post.It might be worth considering commenting out the Return 0 line after detecting the double click so that the user can select a word that way and you can detect the double click as well. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now