zeroZshadow Posted July 27, 2005 Share Posted July 27, 2005 is there a way so i can check if my mouse in over the picture?? like a function that returns 1 if it is above it and 0 if it isn't thanks *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip... Link to comment Share on other sites More sharing options...
Josbe Posted July 27, 2005 Share Posted July 27, 2005 is there a way so i can check if my mouse in over the picture??like a function that returns 1 if it is above it and 0 if it isn'tthanks<{POST_SNAPBACK}>Yes, but the image like a control(GUI), browser? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
seandisanti Posted July 27, 2005 Share Posted July 27, 2005 Yes, but the image like a control(GUI), browser?<{POST_SNAPBACK}>you could just have a loop check mouse coords vs pic coords, and perform statements when the two coincide...check out MouseGetPos(),if the position of the image isn't static, you may want to make use of ControlGetPos() to specify the area you want for the mouse over...with those two functions and a loop w/ condition check, you should have no prob. Link to comment Share on other sites More sharing options...
zeroZshadow Posted July 27, 2005 Author Share Posted July 27, 2005 so you mean like: if $mouseposX > ($picX-1) and < ($picX+picwidht+1) then if $mouseposY > ($picY-1) and < ($picY+picheight+1) then return 1 endif endif *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip... Link to comment Share on other sites More sharing options...
seandisanti Posted July 27, 2005 Share Posted July 27, 2005 (edited) so you mean like:if $mouseposX > ($picX-1) and < ($picX+picwidht+1) then if $mouseposY > ($picY-1) and < ($picY+picheight+1) then return 1 endif endif<{POST_SNAPBACK}>definitely on the right track (except the statement to the right of your and statement isn't one that would be evaluated the way you want it to). try something like this...$pos = GetMousePos() $cpos = ControlGetPos("MyWindow","",1111) if $pos[0] > $cpos[0] and $pos[0] < $cpos[0] + $cpos[2] then if $pos[1] > $cpos[1] and $pos[1] < $cpos[1] + $cpos[3] then MouseOverFuncNameHere() EndIf EndIf***edit***i hadn't initially given the ControlGetPos() the parameters it wanted. the only real changes you would have to make to use that codebit are the arguments for ControlGetPos() and the function name to call when the mouse is over the pic. Edited July 27, 2005 by cameronsdad Link to comment Share on other sites More sharing options...
Lazycat Posted July 27, 2005 Share Posted July 27, 2005 is there a way so i can check if my mouse in over the picture??like a function that returns 1 if it is above it and 0 if it isn'tthanks<{POST_SNAPBACK}>Prevoius suggestions absolutely right for foreign windows. But if you work with Autoit GUI, simpler to use GUIGetCursorInfo, it's return control ID where mouse over (fourth element of return array). Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) 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