Solved

getting notification when a users logs on and off

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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