I realize that the answer to this should be obvious but I am stumped.
The following code:
GetScreenRes>xWidth,xHeight
MouseMove>1280,720
GetCursorPos>X,Y,cType
resulted in the following values:
xWidth=1280
xHeigth=720
x=853
y=480
Why doesn't the MouseMove and GetCursorPos yield the same result (no the mouse did not move in between lines)? Also, after the mouse moved, as a result of the above step, it did not end up in the bottom right hand corner of the screen.
Mousemove and GetCursorPos
Moderators: JRL, Dorian (MJT support)
Are you trying to move your cursor past your screen resolution? Because that's not possible.
Try this example:
Try this example:
Code: Select all
GetScreenRes>xWidth,xHeight
MouseMove>500,400
GetCursorPos>X,Y,cType
MDL>Screen Resolution: %xWidth%,%xHeight%%CRLF%Cursor Position: %X%,%Y%%CRLF%Cursor Type: %cType%
- Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am
I can't replicate the problem, even if I keep the cursor type in.
I'm on a 1600x900. I used this :
The first section gets the screen resolution, moves the mouse to 1280,720, then reports the mouse position correctly as 1280,720.
The second part gets the resolution, moves the mouse pointer to the bottom right corner, and correctly reports the mouse position.
I'm on a 1600x900. I used this :
Code: Select all
GetScreenRes>xWidth,xHeight
MouseMove>1280,720
GetCursorPos>X,Y,cType
mdl>Resolution is %xWidth% x %xHeight%%CRLF%Cursor co-ordinates and type %X%,%Y%,%cType%
GetScreenRes>xWidth,xHeight
MouseMove>%xWidth%,%xHeight%
GetCursorPos>X,Y,cType
mdl>Resolution is %xWidth% x %xHeight%%CRLF%Cursor co-ordinates and type %X%,%Y%,%cType%
The second part gets the resolution, moves the mouse pointer to the bottom right corner, and correctly reports the mouse position.
What does GetSystemMetrics report?
Code: Select all
Let>SM_XVIRTUALSCREEN=76
Let>SM_YVIRTUALSCREEN=77
Let>SM_CXVIRTUALSCREEN=78
Let>SM_CYVIRTUALSCREEN=79
LibFunc>User32,GetSystemMetrics,VScrWidth,SM_CXVIRTUALSCREEN
LibFunc>User32,GetSystemMetrics,VScrHeight,SM_CYVIRTUALSCREEN
LibFunc>User32,GetSystemMetrics,VScrLeft,SM_XVIRTUALSCREEN
LibFunc>User32,GetSystemMetrics,VScrTop,SM_YVIRTUALSCREEN
MDL>%VScrLeft%,%VScrTop% - %VScrWidth%,%VScrHeight%