Wyngnut Posted February 1, 2023 Share Posted February 1, 2023 How do I send a Button Click with GUICtrlSendMsg() to myself? Thanks! Chris Danp2 1 Link to comment Share on other sites More sharing options...
Danp2 Posted February 1, 2023 Share Posted February 1, 2023 No idea what you actually want to accomplish. Perhaps you could post some code showing what you have tried? Why do you need to use GUICtrlSendMsg? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Fingo Posted February 8 Share Posted February 8 Old thread, but relevant for anyone stumbling across this. GUICtrlSendMsg() isn't designed to simulate mouse clicks. Use ControlClick() instead: ; create some GUI $MyGUI = GUICreate( "Test-GUI", ... ) $MyButton = GUICtrlCreateButton( "The button", 10, 10, ...) etc. ; simulate a click on 'The button': ControlClick( $MyGUI, "", $MyButton ) Link to comment Share on other sites More sharing options...
Nine Posted February 8 Share Posted February 8 @Fingo Not precisely true. It could be appropriate under certain circumstances to send a message to self... #include <GUIConstants.au3> Global Const $MK_LBUTTON = 1 Example() Func Example() Local $hGUI = GUICreate("Example", 300, 200) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUISetState() Sleep(1000) ; leave some time to see the GUI GUICtrlSendMsg($idButton_Close, $WM_LBUTTONDOWN, $MK_LBUTTON, 0x00030003) GUICtrlSendMsg($idButton_Close, $WM_LBUTTONUP, $MK_LBUTTON, 0x00030003) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ConsoleWrite("Closing GUI" & @CRLF) ExitLoop EndSwitch WEnd EndFunc ;==>Example “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...
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