Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.25 KB

File metadata and controls

56 lines (36 loc) · 1.25 KB

Home

Function name : WTSRegisterSessionNotification

Group: Terminal Services - Library: wtsapi32


Registers the specified window to receive session change notifications.


Code examples:

Locking the workstation

Declaration:

BOOL WTSRegisterSessionNotification(
  HWND hWnd,
  DWORD dwFlags
);
  

FoxPro declaration:

DECLARE INTEGER WTSRegisterSessionNotification IN Wtsapi32;
	INTEGER hWindow,;
	LONG dwFlags  

Parameters:

hWnd [in] Handle of the window to receive session change notifications.

dwFlags [in] Specifies which session notifications are to be received: NOTIFY_FOR_THIS_SESSION, NOTIFY_FOR_ALL_SESSIONS.


Return value:

If the function succeeds, the return value is TRUE.


Comments:

Session change notifications are sent in the form of a WM_WTSSESSION_CHANGE message. When a window no longer requires these notifications, it must call WTSUnRegisterSessionNotification before being destroyed.

See also: LockWorkStation.