Solved

getting notification when a users logs on and off

Posted on 2002-05-02
3
149 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

19 Experts available now in Live!

Get 1:1 Help Now