I'm trying to screen grab a window. I'm checking that I'm grabbing the foreground window using GetForegroundWindow() so in theory, nothing should be drawn on top of the window.
I then call GetDC(GetDesktop()) and copy the area of the screen that my window occupies to a bitmap.
If I instead, call GetDC(myWindowHandle) I don't get the title bar or borders (or am I missing something here?)
My problem is that I now correctly grab any menus that my application opens but I also grab pop-ups (IM client & Tweetdeck) that are drawn over my application.
I've found the function AnyPopup() which returns true when there is a popup but says this is for backwards compatibility with 16 bit versions of windows and is generally not useful. Is there a simple way of detecting the popups (and their location) or do I have to cycle through all the windows and enumerate all their child windows in turn in order to test if they are on top of my foreground window?