MoveWindow_() placement is slightly off?
Posted: Sat Oct 22, 2022 9:12 pm
Hi,
On Windows 10:
My main screen has a 3840 x 1600 resolution.
I want to place a window on the exact half left side.
1560 because the taskbar is currently 40 px high.
I'm using this on e.g. Notepad.exe
but after the move is done, the x position isn't 0, it's actually 8
y is 0, so that's fine.
The rightmost position is 1912, so it's also 8 px less that it should be
and finally the height is also 8 px less than expected.
Is this typical behavior and is there a formula to know how to correct this "skew"?
Btw, WIN + Left, Right, etc. hotkeys do it correctly, the positions and sizes of windows moved by these are correct so there must be some way to get the skew values?
On Windows 10:
Code: Select all
MoveWindow_(GetForegroundWindow_(), 0, 0, 1920, 1560, 1)
I want to place a window on the exact half left side.
1560 because the taskbar is currently 40 px high.
I'm using this on e.g. Notepad.exe
but after the move is done, the x position isn't 0, it's actually 8
y is 0, so that's fine.
The rightmost position is 1912, so it's also 8 px less that it should be
and finally the height is also 8 px less than expected.
Is this typical behavior and is there a formula to know how to correct this "skew"?
Btw, WIN + Left, Right, etc. hotkeys do it correctly, the positions and sizes of windows moved by these are correct so there must be some way to get the skew values?