How can I move the mouse pointer to the top left corner of the active window?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hellen_dorandt89
Posts: 25
Joined: 05 Jan 2022, 08:25

How can I move the mouse pointer to the top left corner of the active window?

Post by hellen_dorandt89 » 29 Jan 2023, 18:34

Code: Select all

MouseGetPos, OutputVarX, OutputVarY, OutputVarWin, OutputVarControl
MouseMove, %OutputVarX%, %OutputVarY%,0
The above does not work, neither does the following:

Code: Select all

WinGetPos, WinXPos,WinYPos, WinWidth,WinHeight, A
CoordMode, mouse, screen
MouseMove, %WinXPos%, %WinYPos%,0
I have tried many other things as well, what am I doing wrong?

Any help would be greatly appreciated!

User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: How can I move the mouse pointer to the top left corner of the active window?

Post by flyingDman » 29 Jan 2023, 18:51

Try:

Code: Select all

CoordMode, mouse, window
MouseMove, 0, 0
or

Code: Select all

CoordMode, mouse, screen
WinGetActiveStats,t,w,h, OutX, OutY
MouseMove, % OutX, % OutY
14.3 & 1.3.7

Post Reply

Return to “Ask for Help (v1)”