Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
 WTSWaitSystemEvent Function
WTSWaitSystemEvent Function

The WTSWaitSystemEvent function waits for a Remote Desktop Services event before returning to the caller.

Syntax

C++
BOOL WTSWaitSystemEvent(
  __in   HANDLE hServer,
  __in   DWORD EventMask,
  __out  DWORD *pEventFlags
);

Parameters

hServer [in]

Handle to an RD Session Host server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the RD Session Host server on which your application is running.

EventMask [in]

Bitmask that specifies the set of events to wait for. This mask can be WTS_EVENT_FLUSH to cause all pending WTSWaitSystemEvent calls on the specified RD Session Host server handle to return. Or, the mask can be a combination of the following values.

ValueMeaning
WTS_EVENT_ALL

Wait for any event type.

WTS_EVENT_CONNECT

A client connected to a WinStation.

WTS_EVENT_CREATE

A new WinStation was created.

WTS_EVENT_DELETE

An existing WinStation was deleted.

WTS_EVENT_DISCONNECT

A client disconnected from a WinStation.

WTS_EVENT_LICENSE

The Remote Desktop Services's license state changed. This occurs when a license is added or deleted using License Manager.

WTS_EVENT_LOGOFF

A user logged off from either the Remote Desktop Services console or from a client WinStation.

WTS_EVENT_LOGON

A user logged on to the system from either the Remote Desktop Services console or from a client WinStation.

WTS_EVENT_RENAME

An existing WinStation was renamed.

WTS_EVENT_STATECHANGE

A WinStation connection state changed. For a list of connection states, see the WTS_CONNECTSTATE_CLASS enumeration type.

 

pEventFlags [out]

Pointer to a variable that receives a bitmask of the event or events that occurred. The returned mask can be a combination of the values from the previous table, or it can be WTS_EVENT_NONE if the wait terminated because of a WTSWaitSystemEvent call with WTS_EVENT_FLUSH.

Return Value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWtsapi32.h
LibraryWtsapi32.lib
DLLWtsapi32.dll

See Also

WTSOpenServer

Send comments about this topic to Microsoft

Build date: 10/19/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
WTSWaitSystemEvent under Vista (without SP1)      Krystian Bigaj   |   Edit   |   Show History
http://support.microsoft.com/kb/941561

Quote:
"On a Windows Vista-based computer, you develop an application by using the WTSWaitSystemEvent function. When you set the value of the EventMask parameter to WTS_EVENT_FLUSH, all pending WTSWaitSystemEvent function calls on the specified terminal server handle are returned. However, no pending calls to the WTSWaitSystemEvent function return as expected.
..."
Tags What's this?: vista (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker