Вверх ↑
Ответов: 5227
Рейтинг: 587
#1: 2022-03-10 00:04:52 ЛС | профиль | цитата
чисто только ради спортивного интереса и борьбы с бессонницей

Add(MainForm,2953706,189,147)
{
Width=344
Height=321
}
Add(InlineCode,2206947,189,217)
{
EventPoints=#5:onMsg|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|29:uses kol,Windows,Share,Debug;|0:|5:const|88: // The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.|30: WM_WTSSESSION_CHANGE = $2B1;|19: // wParam values:|26: WTS_CONSOLE_CONNECT = 1;|29: WTS_CONSOLE_DISCONNECT = 2;|25: WTS_REMOTE_CONNECT = 3;|28: WTS_REMOTE_DISCONNECT = 4;|24: WTS_SESSION_LOGON = 5;|25: WTS_SESSION_LOGOFF = 6;|23: WTS_SESSION_LOCK = 7;|25: WTS_SESSION_UNLOCK = 8;|33: WTS_SESSION_REMOTE_CONTROL = 9;|79: // Only session notifications involving the session attached to by the window|63: // identified by the hWnd parameter value are to be received.|30: NOTIFY_FOR_THIS_SESSION = 0;|50: // All session notifications are to be received.|32: NOTIFY_FOR_ALL_SESSIONS = 1; |0:|4:type|28: THiAsmClass = class(TDebug)|10: private|25: fOldMsg: TOnMessage;|67: function onMessage(var Msg: TMsg; var Rslt: Integer): Boolean;|9: public|23: onMsg: THI_Event; |24: constructor Create;|20: procedure Init;|5: end;|1: |81: function WTSRegisterSessionNotification(Handle: THandle; Flags: DWORD): boolean;|38: stdcall; external 'Wtsapi32.dll';|0:|14:implementation|0:|74:function THiAsmClass.onMessage(var Msg: TMsg; var Rslt: Integer): Boolean;|3:var|20: strReason: string;|5:begin|21: case Msg.Message of|25: WM_WTSSESSION_CHANGE:|11: begin|26: case Msg.wParam of|66: WTS_CONSOLE_CONNECT: strReason := 'WTS_CONSOLE_CONNECT';|72: WTS_CONSOLE_DISCONNECT: strReason := 'WTS_CONSOLE_DISCONNECT';|64: WTS_REMOTE_CONNECT: strReason := 'WTS_REMOTE_CONNECT';|70: WTS_REMOTE_DISCONNECT: strReason := 'WTS_REMOTE_DISCONNECT';|62: WTS_SESSION_LOGON: strReason := 'WTS_SESSION_LOGON';|64: WTS_SESSION_LOGOFF: strReason := 'WTS_SESSION_LOGOFF';|60: WTS_SESSION_LOCK: strReason := 'WTS_SESSION_LOCK';|64: WTS_SESSION_UNLOCK: strReason := 'WTS_SESSION_UNLOCK';|80: WTS_SESSION_REMOTE_CONTROL: strReason := 'WTS_SESSION_REMOTE_CONTROL';|13: else|38: strReason := 'WTS_Unknown';|12: end;|39: _hi_onEvent(onMsg,strReason); |10: end;|6: end;|44: Result := _hi_OnMessage(fOldMsg,Msg,Rslt);|4:end;|0:|31:constructor THiAsmClass.Create;|5:begin|12: inherited;|16: InitAdd(Init);|4:end;|0:|27:procedure THiAsmClass.Init;|5:begin|42: fOldMsg := Applet.Children[0].OnMessage;|44: Applet.Children[0].OnMessage := onMessage;|84: WTSRegisterSessionNotification(Applet.Children[0].Handle,NOTIFY_FOR_THIS_SESSION);|4:end;|0:|4:end.|
link(onMsg,1892790:doAdd,[])
}
Add(Memo,1892790,252,217)
{
Left=10
Top=10
Width=310
Height=265
AddType=1
ScrollBars=3
}

карма: 4
Мой форум - http://hiasm.bbtalk.me/ схемы, компоненты...
1
Голосовали:Stalevar