EnumWindows and Locked Screen

Posted on 2004-11-25
Last Modified: 2008-02-01
Hi there,

I'm currently using EnumWindows, as I need to close a particular window based on the caption.

Unfortunately this does not work when the machine is locked - the EnumWindows function does not list certain windows. The window I am searching for is a popup which appears above the Windows Locked Screen Message. It is just a "#32770 (Dialog)", nothing special.

Is there any other way to locate such a window within a locked screen? I've also tried FindWindow, etc. All Win32 APIS work fine except when the machine is in a locked/logged off mode.

Question by:mace
    LVL 23

    Accepted Solution

    A couple of points to consider:

    1) EnumWindows() does not enumerate all child windows.  If your target is a child window, use EnumChildWindows() for each window returned by EnumWindows.

    2) It's probably not needed here, but you may want to consider starting your enumeration with EnumWindowStations(), then EnumDesktops() within each station, then EnumDesktopWindows() for each desktop.

    Note that the Computer Locked window belongs to the Logon desktop and not the default user desktop.

    Author Comment

    Thanks. That certainly put me in the right direction!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 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

    10 Experts available now in Live!

    Get 1:1 Help Now