Nasty gotcha: Positioning your window beneath a topmost window makes it topmost

This post has been republished via RSS; it originally appeared at: Microsoft Developer Blogs - Feed.

There's a nasty gotcha with the Defer­Window­Pos function, and therefore any functions built on top of it, such as Set­Window­Pos: If you specify a hwndInsertAfter, and the insert-after window is topmost, then the window being positioned will be placed immediately after that window.

So far so good.

The hidden gotcha is that the window will be placed in the same zone as the insert-after window, which is the topmost zone.

In other words, the window will be made topmost, even if it wasn't topmost previously.

Which is probably not what you were expecting.

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.