How to get notified in VC6 about workstation unlocking

Posted on 2004-10-21
Medium Priority
Last Modified: 2013-11-20
I need to be notified every time the user unlocks the workstation.

Ok, in VC7 I can register my window using WTSRegisterSessionNotification to be able to proccess in its WindowProc the message WM_WTSSESSION_CHANGE, whose parameters can tell me about locking/unlocking of the workstation.
But this requires VC7, XP...

Is there any way to know that in previous OSs & VC6?

Question by:Hernan_Berguan
1 Comment
LVL 86

Accepted Solution

jkr earned 375 total points
ID: 12372101
You could simply write your own Winlogon Notification Package - see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/winlogon_notification_packages.asp ("Winlogon Notification Packages"). It basically boils down to creating a DLL that has the following functionality

//Event handler for the Winlogon Logon event
   //Print the name of the handler to debug output.
   //You can replace this with more useful functionality.
   OutputDebugString (TEXT("NOTIFY:  Entering WLEventUnlock.\r\n"));

and is registered with the system under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify

DllName = mynotifdll.dll
Unlock = "WLEventUnlock"


Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…

601 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