MHz Posted October 4, 2004 Posted October 4, 2004 I considered to locate a controls position with ControlGetPos. Then to move the mouse to that control, but co-ordinates are not received correctly? I also find that the array returned may be reversed at times i.e ('x, y' or 'y, x'). Swapping arrays does not help to reverse? Or maybe my understanding of using this function is incorrect? Sample; Mousemove to Calculator - button 7 Opt("MouseCoordMode", 0) WinActivate("Calculator") $POS = ControlGetPos("Calculator", "", "Button5") MsgBox(0, "Button 7", "Position is: " & $POS[0] & ", " & $POS[1]) WinActivate("Calculator") MouseMove($POS[0], $POS[1])
CyberSlug Posted October 4, 2004 Posted October 4, 2004 (edited) MouseMove only supports absolute screen coordinates.Opt("MouseCoordMode", 1) tells the ControlGetPos to report relative coordinates, so you need to change the MouseCoordMode to zero.Edit: Yeah, what Larry said Edited October 4, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Developers Jos Posted October 5, 2004 Developers Posted October 5, 2004 controls are placed in the "client" area of a window. You will need to adjust Mouse coords by - getting the Window size...- getting the window's Client size- subtract 1/2 of the difference in widths for X adjustment- subtract the difference in height and add 1/2 the difference in width for YI'm lazy now, but will elaborate later if someone else doesn'tLAr.<{POST_SNAPBACK}>check out this post for a scriptlet : http://www.autoitscript.com/forum/index.ph...indpost&p=11831 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
MHz Posted October 5, 2004 Author Posted October 5, 2004 To find a control on a window, i need to do a series of calculations to locate the control? ControlGetPos is not used for this purpose? I do not recognize any other function that may interact with ControlGetPos? It's existence depends on retrieving the position and size of a control relative to it's window? Does ControlGetPos have a reason to exist?
Guest BL@(K-R34P3R Posted October 5, 2004 Posted October 5, 2004 That's what I think too, because ControlClick can click in a minimized window, but only at the current mouse position, as far as I know, it cannot click on specific coordinates unless in window or maximized. Could be useful to retrieve the coordinates of the mouse so that when you maximize the window you will know where it will be.
MHz Posted October 5, 2004 Author Posted October 5, 2004 That's what I think too, because ControlClick can click in a minimized window, but only at the current mouse position, as far as I know, it cannot click on specific coordinates unless in window or maximized. Could be useful to retrieve the coordinates of the mouse so that when you maximize the window you will know where it will be.<{POST_SNAPBACK}>The coordinates that ControlGetPos seems not useful for mouse functions.If you want to know where the mouse is, try MouseGetPos.
Developers Jos Posted October 5, 2004 Developers Posted October 5, 2004 To find a control on a window, i need to do a series of calculations to locate the control? ControlGetPos is not used for this purpose? I do not recognize any other function that may interact with ControlGetPos? It's existence depends on retrieving the position and size of a control relative to it's window?Does ControlGetPos have a reason to exist?<{POST_SNAPBACK}>The Control position info is relative the Windows client area and the mouse functions are relative the the whole window including its frame...ControlGetPos could be use together with ControlMove. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
MHz Posted October 5, 2004 Author Posted October 5, 2004 @ Larry you win, lol, but... If what you say about themes, making a window larger or smaller, would that have an effect on mouse functions and others. Would they fail as the reliance on the window being the same size?
Administrators Jon Posted October 5, 2004 Administrators Posted October 5, 2004 Maybe time to add a new mode for the mouse modes: screen, active window and active window client area. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
MHz Posted October 5, 2004 Author Posted October 5, 2004 @Jon, I would welcome this proposition. Thanks.
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