Solved

getting notification when a users logs on and off

Posted on 2002-05-02
3
154 Views
Last Modified: 2010-04-04
I am writing a service application and would like to know if there is a way to be notified by windows (2000, XP) when a user logs on and off the computer.
0
Comment
Question by:mdlittle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Expert Comment

by:W_Fox
ID: 6986910
I haven't developed services [yet], but if they receive standard windows messages, maybe trapping WM_USERCHANGED is the way. just my $0.02

W_Fox
0
 
LVL 8

Expert Comment

by:Cesario
ID: 6987011
w Fox is right

The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.

WM_USERCHANGED  
wParam = 0;       // not used, must be zero
lParam = 0;       // not used, must be zero
0
 
LVL 8

Accepted Solution

by:
Cesario earned 500 total points
ID: 6987069
If you are using a Service App then catch it in your message loop..

other wise

through a TAppEvents control onto a form

and have some code like

case Msg.Msg of
  WM_USERCHANGED : // your code here
  // other stuff
 end;


Best Regards

Cesario
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 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