Solved

getting notification when a users logs on and off

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

12 Experts available now in Live!

Get 1:1 Help Now