Hi,
Newb here, obviously.
I'm trying to make a macro that will work on anyone's screen, at any window size for a given program.
I need the macro to click on a red button (using the findcolor function to find it), then click on another red button that is always the same relative distance from red button 1.
But I notice that there is no function for finding the relative position of a mouse pointer...only a function to move it a relative distance. Which is odd, because the editor itself can show relative position, but there is no function for it?
Finding Relative Position of Cursor?
Moderators: Dorian (MJT support), JRL
In order fro a position to be relative, it needs to be related to something else. The "Relative" setting in the editor displays the current cursor position relative to the screen coordinates of the zero point of the current active window. Its true there is no built in function to display the relative cursor coordinates but its an easy calculation based on GetActiveWindow and GetCursorPos. The following will produce the same result as the Editor's relative mouse position setting.But I notice that there is no function for finding the relative position of a mouse pointer...
Code: Select all
GetActiveWindow>WinTitle,WinX,WinY
GetCursorPos>CurX,CurY
Let>RelPosX=%WinX%-%CurX%
Let>RelPosY=%WinY%-%CurY%