Helge Posted June 13, 2005 Share Posted June 13, 2005 I'm currently working on a project, where I'm using GUIGetCursorInfo() tocheck for a mouseclick. So while I was bug-testing this project of mine today,I found out that GUIGetCursorInfo() acts the same as when the GUI is activeand when it ain't. This, of course, isn't what I want as it gives strange results.This even occurs when specifying the window-handle, which got me thinkingthat there might be bug with GUIGetCursorInfo(). See the example below :#include <GUIConstants.au3> Opt("WinTitleMatchMode",4) $wHandle = GUICreate("Test : GGCI on inactive GUI",400,400) $cButton = GUICtrlCreateButton("Click area...Minimize and click..",10,10,380,380) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE $curInfo = GUIGetCursorInfo($wHandle) If $curInfo[2] AND $curInfo[4] = $cButton Then If WinActive("handle=" & $wHandle) Then MsgBox(64,"","Minimize...and THEN click.") Else MsgBox(64,"","You clicked.") EndIf EndIf WEnd Link to comment Share on other sites More sharing options...
therks Posted June 13, 2005 Share Posted June 13, 2005 Well, when it's minimized it seems to work normally... But, I did notice, that when I had this window (Internet Explorer) over top of the GUI window, and clicked where the button WOULD be, I got the message box. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Helge Posted June 13, 2005 Author Share Posted June 13, 2005 Yes, you're correct.It works normally when it is minimized, however if you make theGUI inactive by opening another window (like you said), it actsstrange again. Is it supposed to be like this, or is it a bug ? Well, when it's minimized it seems to work normally...But, I did notice, that when I had this window (Internet Explorer) over top of the GUI window, and clicked where the button WOULD be, I got the message box.<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
layer Posted June 14, 2005 Share Posted June 14, 2005 (edited) *Bump*EDIT: If this is normal, than maybe an Optional paremeter could be used to toggle this? Edited June 14, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
jpm Posted June 14, 2005 Share Posted June 14, 2005 Yes, you're correct.It works normally when it is minimized, however if you make theGUI inactive by opening another window (like you said), it actsstrange again. Is it supposed to be like this, or is it a bug ? <{POST_SNAPBACK}>Jon design this function, so I am not sure if he really want to return info when the gui is not active.I will add some checking to return info only if the GUI is active when no winhandle is given. Link to comment Share on other sites More sharing options...
Helge Posted June 14, 2005 Author Share Posted June 14, 2005 Thanks jpm !! Link to comment Share on other sites More sharing options...
jpm Posted June 14, 2005 Share Posted June 14, 2005 Thanks jpm !!<{POST_SNAPBACK}>Your script will have to check @error before using the GUIGetCursorInfo because no array will be returnedIf @error = 0 AND $curInfo[2] AND $curInfo[4] = $cButton Then 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