get screen grab of Winlogon desktop

Posted on 2006-04-11
Last Modified: 2009-07-29
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,

Question by:JustinWillis
    LVL 17

    Accepted Solution

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

    Author Comment

    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.

    LVL 1

    Author Comment

    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.


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now