OpenInputDesktop() to determine Secure/Login desktop
问题 Visual C++ 2008 How to establish whether or not the currently interactive user is at either the Locked desktop (Windows-Key L) or the Shutdown Screen (Vista or 7) waiting for programs to close during log-out. HDESK hd = OpenInputDesktop(0, false, READ_CONTROL); This works fine for a user app on the Default desktop, but fails with error Code 5 when at the Locked or Shutdown desktops due to, I understand, the user not having permissions to open the secure desktop object. Calling this from a