WinGetPos - broken when composition is enabled

Report problems with documented functionality
User avatar
cyruz
Posts: 295
Joined: 30 Sep 2013, 13:31

WinGetPos - broken when composition is enabled

15 Sep 2019, 20:12

Hi lexikos,

I just step on this issue every now and then, so I decided to report a bug.

The position values of WinGetPos are not correct when composition is enabled. With composition enabled DwmGetWindowAttribute with DWMWA_EXTENDED_FRAME_BOUNDS should be used instead of GetWindowRect to get the right values.

This seems to be consistent from Window 7 to 10, I didn't try Vista, nor XP.


Cheers :beer:
ABCza on the old forum.
My GitHub.
guest3456
Posts: 2680
Joined: 09 Oct 2013, 10:31

Re: WinGetPos - broken when composition is enabled

16 Sep 2019, 20:04

the only difference i've noticed is that on win10, there are invisible borders that you can't see visually, but those borders are still there. so GetWindowRect does in fact report the correct values which include those invisible resizing borders.

there was a long thread about this at some point before

you could use WinGetPosEx here:
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=3392

User avatar
cyruz
Posts: 295
Joined: 30 Sep 2013, 13:31

Re: WinGetPos - broken when composition is enabled

16 Sep 2019, 21:33

@guest3456

Yeah actually I don't know if it's correct to define it a bug, as it's just an implementation of a Windows API, but I still find it strange that we have to recur to third parties solutions for this. That "invisible borders" should be present from Vista onward due to the composition manager.

Thanks, I know of that thread, I implemented my own function long ago.
ABCza on the old forum.
My GitHub.
guest3456
Posts: 2680
Joined: 09 Oct 2013, 10:31

Re: WinGetPos - broken when composition is enabled

16 Sep 2019, 23:48

Invisible borders were not present on Vista, 7, 8, or 8.1, only win10


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 13 guests