CYCho Posted June 20, 2020 Share Posted June 20, 2020 (edited) The following code does not work. #include <GUIConstantsEx.au3> GUICreate(" My GUI input control", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) Local $idInput = GUICtrlCreateInput("", 10, 5, 300, 20) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idInput MsgBox(0, "", "Input control was clicked") EndSwitch WEnd Having not found a handy way to make it work, I created a label control beneath the input control and it simulates detection of click on input control. #include <GUIConstantsEx.au3> GUICreate(" My GUI input control", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) Local $idLabel = GUICtrlCreateLabel("", 10, 5, 300, 20) Local $idInput = GUICtrlCreateInput("", 10, 5, 300, 20) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idLabel MsgBox(0, "", "Input control was clicked") EndSwitch WEnd Is this a viable way? Or is there a better way to make this happen? Edited June 22, 2020 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Nine Posted June 20, 2020 Share Posted June 20, 2020 Message hook will let you do it : #include <WinAPI.au3> #include <GUIConstants.au3> GUICreate(" My GUI input control", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) Local $idInput = GUICtrlCreateInput("", 10, 5, 300, 20) $wProcHandle = DllCallbackRegister("_WindowProc", "ptr", "hwnd;uint;wparam;lparam") $wProcOld = _WinAPI_SetWindowLong(GUICtrlGetHandle($idInput), $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle)) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd DllCallbackFree($wProcHandle) Func _WindowProc($hWnd, $Msg, $wParam, $lParam) If $hWnd = GUICtrlGetHandle($idInput) And $Msg = $WM_LBUTTONDOWN Then ConsoleWrite("-> Left mouse simple click" & @LF) EndIf Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam) EndFunc ;==>_WindowProc CYCho 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
careca Posted June 21, 2020 Share Posted June 21, 2020 #include <GUIConstantsEx.au3> Local $GUI = GUICreate(" My GUI input control", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) Local $idInput = GUICtrlCreateInput("", 10, 5, 300, 20) Local $CurInfo GUISetState(@SW_SHOW) While 1 $CurInfo = GUIGetCursorInfo($GUI) If $CurInfo[4] = $idInput And $CurInfo[2] = 1 Then MsgBox(64 + 262144, '', '') EndIf ;============================================================================= Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Sleep(100) WEnd Or like this ad777 and CYCho 1 1 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
CYCho Posted June 22, 2020 Author Share Posted June 22, 2020 @Nine and @careca, Thank you for your kind attention and knowledgeable suggestions. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment 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