WinMove - not the same position on every window Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
patrick227
Posts: 3
Joined: 24 Jun 2017, 08:32

WinMove - not the same position on every window

24 Jun 2017, 08:51

Hi,
I'm positioning the active window like this

Code: Select all

x:= 0
y:= 0
w:= 500
h:= 200

WinMove,A,, x, y, w, h
My Problem is that not all windows end up on the exact same position, most native Windows10 windows end up on the same position, but for example Thunderbird is 3px off, even worse VisualStudio is ~10px off.
I think there must be some window border variable or some other method I can use to set the real window x- and y-position (maybe also the size width and height is a problem). Can you help me, please? :)
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: WinMove - not the same position on every window

24 Jun 2017, 12:45

Winmove is working correctly it appears to be off from win10's invisible window borders.

Try this test script and you can see for yourself:

Code: Select all

1::
    x:= 0 , y:= 0 , w:= 500 , h:= 200
    WinMove, A,, x, y, w, h
    WinGetPos, wx, wy, ww, wh, A
	movePos := "WinMove`n`nx= " . x . "`ny= " . y . "`nw= " . w . "`nh= " . h
	getPos := "WinGetPos`n`nx= " . wx . "`ny= " . wy . "`nw= " . ww . "`nh= " . wh
    MsgBox,, Window Stats:, % movePos . "`n`n---------`n`n" .  getPos
return
HTH
patrick227
Posts: 3
Joined: 24 Jun 2017, 08:32

Re: WinMove - not the same position on every window

24 Jun 2017, 13:38

Thank you, that's what I mean, how can I get the border thickness of each window?
robertcollier4
Posts: 33
Joined: 09 Apr 2016, 22:14

Re: WinMove - not the same position on every window  Topic is solved

24 Jun 2017, 14:54

https://autohotkey.com/boards/viewtopic.php?t=17955 - WinMove is broken on Windows 10
https://autohotkey.com/board/topic/1498 ... alignment/ - winmove in windows 10 misalignment
https://autohotkey.com/boards/viewtopic.php?t=3392 - [Function] WinGetPosEx v0.1 (Preview) - Get the real position and size of a window
patrick227
Posts: 3
Joined: 24 Jun 2017, 08:32

Re: WinMove - not the same position on every window

24 Jun 2017, 14:58

Great! WinGetPosEx does the job :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, CrowexBR, Google [Bot], mcd, rubeusmalfoy, ShatterCoder and 83 guests