• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1286
  • Last Modified:

get screen grab of Winlogon desktop

Hi guys, there are tonnes of examples of how to capture the current desktop to a bitmap etc, but I also want to capture the ctrl+alt+del options and the workstation locked screen, my app is running as a local service and I have successfully accessed the Winlogon desktop for the purpose of simulating a ctrl+alt+del and can use the mouse and keyboard on this desktop but I cannot access it for the purpose of storing in a bitmap.

This is for a remote access app I have been working on and this is the final peace to the very large puzzle, it's not in the box, I have looked, any one know where it is? :P

I know it is probably tempting to say "it's not possible for security reasons" but I have read that so many times and have managed to get this far, other remote apps can do it and I bet it is pretty simple when you know how so hoping someone does!

Thanks in advance,

  • 2
1 Solution
TheRealLokiSenior DeveloperCommented:
I don't know how to do this, but here's some ideas
Is the issue that it is the "Local System's desktop" and not the "current logged on user's desktop"
You know how you can do a CreateDesktop() and have "hidden desktops" and switch between them if you like. Maybe it's like this.
Perhaps an OpenDesktop(), or some API to "Get specific desktop's handle" would allow you to see it and bitblt or copy it ? [shrug] just guessing :-)
JustinWillisAuthor Commented:
Yes that is how I have currently accessed the Winlogon Desktop but I have done so in an Indy Thread to satisfy the security, I use to use...

  dc: HDC; lpPal : PLOGPALETTE;
{get the screen dc}
  dc := GetDc(GetDesktopWindow);

But I think GetDesktopWindow may be the wrong thing to be using as i does not seem to be successful, I may be wrong though, maybe another reason it is failing, have not finished testing it to confirm.

Cheers for interest and help in previous question.

JustinWillisAuthor Commented:
After some testing I think I have found what I have done wrong, TheRealLoki your message got me checking the OpenDesktop() code which was indeed at fault, was not taking the screen grab while winlogon desktop had focus, sounds like a stupid mistake to make but handling another thread in the service makes this a little trickier :P

Cheers for your help.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now