pietrog Posted September 22, 2006 Share Posted September 22, 2006 Looking to have the script quit when either the mouse is moved or any key is pressed. The keypress doesn't seem to trigger when I create the picture control. If I comment out the GUICtrlCreatePic line, it works. If I leave it in, only the mouse move will terminate the script. I'd appreciate any insight. Thanks #include <GUIConstants.au3> Global Const $WM_KEYDOWN = 0x0100 Opt("RunErrorsFatal", 0) Opt("GUIOnEventMode", 1) $hGUI = GUICreate('test',300,200, 0, 0) GUIRegisterMsg($WM_KEYDOWN, 'Terminate') GUISetOnEvent($GUI_EVENT_MOUSEMOVE, 'TermEvent') $pic = GUICtrlCreatePic(@WindowsDir & '\lanma256.bmp', 10, 10, 0, 0) GUISetState() While 1 WEnd Func Terminate($hWnd, $msg, $wParam, $lParam) Exit EndFunc ;==>Terminate Func TermEvent() Exit EndFunc ;==>TermEvent Link to comment Share on other sites More sharing options...
MHz Posted September 22, 2006 Share Posted September 22, 2006 How about trying to disable the state of the pic so no messages are received from it. GuiCtrlSetState($pic, $GUI_DISABLE) Done off top of my head so do check syntax. Link to comment Share on other sites More sharing options...
pietrog Posted September 22, 2006 Author Share Posted September 22, 2006 Thanks - that worked perfectly. 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