开发者

Very negative values from GetWindowRect for Explorer windows when using VirtuaWin

开发者 https://www.devze.com 2023-02-13 00:29 出处:网络
I\'m hacking together something that lists e开发者_StackOverflow中文版very window on my Windows box, and it seems that for (only) one of my windows GetWindowRect is returning a rectangle with very neg

I'm hacking together something that lists e开发者_StackOverflow中文版very window on my Windows box, and it seems that for (only) one of my windows GetWindowRect is returning a rectangle with very negative y-coordinates.

Possible complications: (1) I have multiple monitors but (1a) the y-coordinate is very negative, on the order of -24000, and (1b) other windows, on both monitors, don't show this effect; (2) I am using the VirtuaWin virtual desktop tool but (2a) other windows, on multiple different virtual desktops and both monitors, don't show this effect; (3) I'm doing all this in Python, using the pywin32 modules.

The window in question is a Windows Explorer window. It isn't unusually sized or placed (by eye, at least). Explorer windows on the currently active virtual desktop don't show this behaviour, but when I create Explorer windows on other virtual desktops they show the same unexpected effect.

I'm running Windows XP, and version 4.3 of VirtuaWin.

So, what's going on?


So, it turns out that it's nothing to do with Python or multiple monitors. VirtuaWin has two different ways of hiding windows on non-current virtual desktops. One of them involves hiding windows; the other involves messing with their coordinates to move them offscreen.

The coordinate-mangling technique is used for Windows Explorer windows (and also, I believe, windows for some versions of Internet Explorer) because these applications, if you hide a window and then make a new one, close the previously hidden window!

Accordingly, versions of VirtuaWin from 2.6 onwards move windows belonging to these applications offscreen rather than hiding them.

The effect is that these windows' y-coordinates have 25000 subtracted from their "true" values.

0

精彩评论

暂无评论...
验证码 换一张
取 消