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,

JustinWillis.
LVL 1
JustinWillisAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 :-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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...

var
  dc: HDC; lpPal : PLOGPALETTE;
begin
{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.

Justin.
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.

JustinWillis.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.