library Project1;
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls,
Registry,
ShellApi,
MpuWinNT
in '
MpuWinNT.pas';
{$R *.res}
type
PFNMSGECALLBACK =
function (bVerbose: BOOL; lpMessage: PWideChar):
DWORD;
stdcall;
{$EXTERNALSYM PFNMSGECALLBACK}
TFnMsgeCallback = PFNMSGECALLBACK;
PWLX_NOTIFICATION_INFO = ^WLX_NOTIFICATION_INFO;
{$EXTERNALSYM PWLX_NOTIFICATION_INFO}
_WLX_NOTIFICATION_INFO =
record
Size: ULONG;
Flags: ULONG;
UserName: PWideChar;
Domain: PWideChar;
WindowStation: PWideChar;
hToken: THandle;
hDesktop: HDESK;
pStatusCallback: PFNMSGECALLBACK;
end;
{$EXTERNALSYM _WLX_NOTIFICATION_INFO}
WLX_NOTIFICATION_INFO = _WLX_NOTIFICATION_INFO;
{$EXTERNALSYM WLX_NOTIFICATION_INFO}
TWlxNotificationInfo = WLX_NOTIFICATION_INFO;
PWlxNotificationInfo = PWLX_NOTIFICATION_INFO;
function MessageBoxTimeOut(hWnd: HWND; lpText: PChar; lpCaption: PChar; uType: UINT;
wLanguageId: WORD; dwMilliseconds: DWORD): Integer;
stdcall;
external user32
name '
MessageBoxTimeoutA'
function MessageBoxTimeOutA(hWnd: HWND; lpText: PChar; lpCaption: PChar; uType: UINT;
wLanguageId: WORD; dwMilliseconds: DWORD): Integer;
stdcall;
external user32
name '
MessageBoxTimeoutA'
function MessageBoxTimeOutW(hWnd: HWND; lpText: PWideChar; lpCaption: PWideChar; uType: UINT;
wLanguageId: WORD; dwMilliseconds: DWORD): Integer;
stdcall;
external user32
name '
MessageBoxTimeoutW'
var
ret : DWORD;
s :
string;
procedure ServerWallLogoff(pInfo: PWLX_NOTIFICATION_INFO);
stdcall;
begin
ret := MessageBoxTimeOut(
Handle, '
Diese MessageBox schließt sich in 3 Sekunden',
'
MessageBoxTimeOut', MB_OKCANCEL
or MB_ICONINFORMATION, 0, 3000);
case ret
of
IDOK: s := '
OK';
IDCANCEL: s := '
Cancel';
MB_TIMEDOUT: s := '
TimedOut';
end;
ShowMessage(s);
end;
exports
ServerWallLogoff;
begin
end.