I would like to capture workstation lock and unlock and user logon and logoff events. I already wrote a program which overrides the WndProc function, but this does not capture logon and logoff events (as the application is quit or not yet started when this event occurs).
So I thought it might work using a service. I already read Receive Windows Messages in a Service, but I could not find a GetMessage()
in C#.
How do I accomplish reading Windows messages in a service using C#?
BTW, I also tried the approach in Message pump in .NET Windows service, but I could not figure out how this fits into my problem. Also, the reference Microsoft link is not available any more...