How to get notified in VC6 about workstation unlocking

Posted on 2004-10-21
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

    You could simply write your own Winlogon Notification Package - see ("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"


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Cisco Complete Network Certification Training

    If you’re an IT engineer or technician, it's time you take your career to the next level. This elite training bundle is brimming with all of the information you need to learn to sit for Cisco CNNA, CCNP, and CCENT certification exams.

    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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    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.
    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…

    933 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