views:

71

answers:

1

I want to take a screenshot of desktop while Windows is locked (with Win+L). Standard methods make a black screen, with code of pixel:

COLORREF color = GetPixel(hdc, x, y);

equal -1. Neither a user mode program nor a service could capture a useful image. Any ideas?

A: 

GetPixel and BitBlt won't work when the desktop isn't physically displayed on the monitor.

You may have some luck capturing individual windows with PrintWindow. However, not all applications respond to PrintWindow calls the same way, so you may see glitches and/or blackness. You'll also need to capture each window individually.

Tim Robinson
I correctly understand you: you suggest to organize a cycle and make a screenshot of everyone window?If I will use HWND parameter equal 0, it will copy to DC all desktop?In spite of all, thank you.
Anticreativshik
It'll ask the desktop to paint itself into the `HDC` of your choice, which I think gets you a copy of the user's wallpaper, and possibly their icons.
Tim Robinson
Ok. thank you, I will try and then I will post results.
Anticreativshik