Services can be notified when a user logs off a system but not when a
user logs on. A service receives a notification from the system by
installing a Console Control handler. The handler receives a
CTRL_LOGOFF_EVENT when the interactive user logs off the system. For more
information on Console Control handlers, please refer to the Win32 SDK
Online Reference.
A service can determine whether an interactive user is logged on by
determining whether the process specified in the following key is running:
In this key, the process specified by the value shell is launched when an
interactive user logs onto a system. If this process is running, it
indicates that there is an interactive user logged on. To enumerate the
processes on a Windows NT system, the service needs to examine the Windows
NT performance counters. For more information, please refer to either the
TLIST sample on the Win32 SDK or the Win32 SDK Online References.
-----Original Message-----
From: Babu Niranjan [SMTP:xxxxx@blr.spcnl.co.in]
Sent: Tuesday, September 12, 2000 4:17 PM
To: NT Developers Interest List
Subject: [ntdev] Waiting for NT Logoff
Hi,
In a Windows NT service, in response to a remote request from
another machine, I would like to do the following:
Determine if any interactive user is logged in.
If yes, log him off. Wait till logoff is completed.
After logoff is completed, start a custom task.
Any ideas on how to accomplish 1 and 2. Any clues will be
appreciated.
Thanks in advance,
Niranjan Babu
Siemens.
You are currently subscribed to ntdev as: xxxxx@nestec.net
To unsubscribe send a blank email to $subst(‘Email.Unsub’)