Hi,
I want to show screenshot of image along with tooltip of a window. When
window is visible and not minimized then I am able to get the screen shot
but if window is minimized then I am not able to get the screenshot. Is it
possible to get a screen shot of minimized window like passing a fake DC
with WM_PAINT message where window can draw its contents…
Thanks
Ashish
I’m guessing that the easiest way would be to use SendInput to send an
Alt-PrntScrn keystroke, then go look in the clipboard. That could trash
something if done asynchronously, but if you’re doing it asynchronously
(i.e. without the user’s intervention or at least knowledge) then you’re
being naughty and I don’t care to help you :-).
Ashish wrote:
Hi,
I want to show screenshot of image along with tooltip of a window. When
window is visible and not minimized then I am able to get the screen
shot but if window is minimized then I am not able to get the
screenshot. Is it possible to get a screen shot of minimized window like
passing a fake DC with WM_PAINT message where window can draw its
contents…
Thanks
Ashish
–
…/ray..
Please remove “.spamblock” from my email address if you need to contact
me outside the newsgroup.
Ray Trent wrote:
I’m guessing that the easiest way would be to use SendInput to send an
Alt-PrntScrn keystroke, then go look in the clipboard. That could
trash something if done asynchronously, but if you’re doing it
asynchronously (i.e. without the user’s intervention or at least
knowledge) then you’re being naughty and I don’t care to help you :-).
That doesn’t do anything for a window that is minimized, as he noted.
Ashish is correct, there is no way in Windows to get a snapshot of a
window that is not visible. Even the faked WM_PAINT message isn’t
reliable, because dialog-based MFC applications check the current window
state and take a different action when minimized.
The problem is not solveable in the general case. X can do this, if
backing store is turned on, but not Windows.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Ashish wrote:
> Hi,
> I want to show screenshot of image along with tooltip of a window.
> When window is visible and not minimized then I am able to get the
> screen shot but if window is minimized then I am not able to get the
> screenshot. Is it possible to get a screen shot of minimized window
> like passing a fake DC with WM_PAINT message where window can draw
> its contents…
>
> Thanks
> Ashish
Sorry, I misread the mangled English…
In that case, I think the only thing that would work is to restore the
window, snapshot it and minimize it again. As you mention there are tons
of things that won’t work right on a minimized window.
Now, if you are the author of the minimized app in question and can
change the code, that’s a different matter, and something might be
possible. The problem would end up being all the little controls managed
by Windows that most people leave to the default behavior. Getting them
to repaint themselves into a faked-up GC would likely be hard.
Tim Roberts wrote:
Ray Trent wrote:
> I’m guessing that the easiest way would be to use SendInput to send an
> Alt-PrntScrn keystroke, then go look in the clipboard. That could
> trash something if done asynchronously, but if you’re doing it
> asynchronously (i.e. without the user’s intervention or at least
> knowledge) then you’re being naughty and I don’t care to help you :-).
That doesn’t do anything for a window that is minimized, as he noted.
Ashish is correct, there is no way in Windows to get a snapshot of a
window that is not visible. Even the faked WM_PAINT message isn’t
reliable, because dialog-based MFC applications check the current window
state and take a different action when minimized.
The problem is not solveable in the general case. X can do this, if
backing store is turned on, but not Windows.
–
…/ray..
Please remove “.spamblock” from my email address if you need to contact
me outside the newsgroup.