unit Wtsapi;
interface
uses
Windows;
const
// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.
WM_WTSSESSION_CHANGE = $2B1;
// wParam values:
WTS_CONSOLE_CONNECT = 1;
WTS_CONSOLE_DISCONNECT = 2;
WTS_REMOTE_CONNECT = 3;
WTS_REMOTE_DISCONNECT = 4;
WTS_SESSION_LOGON = 5;
WTS_SESSION_LOGOFF = 6;
WTS_SESSION_LOCK = 7;
WTS_SESSION_UNLOCK = 8;
WTS_SESSION_REMOTE_CONTROL = 9;
// Only session notifications involving the session attached to by the window
// identified by the hWnd parameter value are to be received.
NOTIFY_FOR_THIS_SESSION = 0;
// All session notifications are to be received.
NOTIFY_FOR_ALL_SESSIONS = 1;
function RegisterSessionNotification(Wnd: HWND; dwFlags: DWORD): Boolean;
function UnRegisterSessionNotification(Wnd: HWND): Boolean;
function GetCurrentSessionID: Integer;
implementation
function RegisterS
【Delphi】获取windows切换用户消息
最新推荐文章于 2021-04-29 15:40:23 发布