Click here to Skip to main content
15,894,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am developing Screen sharing application. I am using below code.
C++
HDC hdcDesktop = GetDC(NULL);
StretchBlt(m_hScreenDC, 0,0, m_captureWidth, m_captureHeight, hdcDesktop,
            0,0, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), SRCCOPY);
ReleaseDC(NULL,hdcDesktop);

Its working perfectly but not working when screen is locked. There is some Automation application running on my machine and I want to see working of it by monitoring it but not my screen capturer not working on locked machine.

So far I know is window create secure desktop and above code will not work.

I believe WebEx also not working on locked machine.

Any one have any suggestion OR Idea please share.
Posted
Updated 28-Jun-15 21:54pm
v2
Comments
Sergey Alexandrovich Kryukov 28-Jun-15 22:58pm    
What is the OS version? What do you want to capture, the logon screen? Why? If not, how can you capture something which does not even exist? Can you see the contradiction? "Screenshot" means the image of what is on screen, but this is a logon screen.
—SA

1 solution

The logon screen is an isolated desktop running under NT_AUTHORITY\SYSTEM where you don't have access.
To be able to use GUI on such private environment there are some shortcuts like this[^], but the definitive tool is PsExec[^] by SysInternal's Mark Russinovich. It uses a service helper to run programs on a remote machine, or on a local machine as NT_AUTHORITY\SYSTEM. The helper service opens a named pipe to communicate with local application to get commands and return status.
PsExec is not redistribuitable and sources are not available, but exists an open version called PaExec[^]. You can download it and have a look...
You should use PaExec to launch your app under NT_AUTHORITY\SYSTEM to have access to the DC of logon screen and capture immages. But as I said this is an isolated DC so to catch snapshots from user screen and system screen you have to run 2 instances of your app.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900