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

EnumWindows and Locked Screen

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.

1 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.
maceAuthor Commented:
Thanks. That certainly put me in the right direction!

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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