blacksun
Сообщений: 2360
Оценки: 0
Присоединился: 2006-09-27 03:05:59.350000
|
Example [API]: quote:
program Antireboot;
uses
Windows,
Messages;
var
MainWndClass: TWndClass;
hWindow: THandle;
Msg: TMsg;
{$R Ico.res}
function MainWndProc(hWindow: HWND; Msg: UINT; wParam: wParam;
lParam: lParam): LRESULT; stdcall; export;
begin
Result := 0;
case Msg of
WM_QUERYENDSESSION:
Result := Integer(False);
else
begin
Result := DefWindowProc(hWindow, Msg, wParam, lParam);
Exit;
end;
end;
end;
procedure CreateMainForm;
begin
with MainWndClass do
begin
lpszClassName := 'BlackSun.Wnd';
lpfnWndProc := @MainWndProc;
Style := CS_VREDRAW or CS_HREDRAW;
hInstance := hInstance;
hIcon := LoadIcon(hInstance, IDI_APPLICATION);
hCursor := LoadCursor(0, IDC_ARROW);
hbrBackground := COLOR_BACKGROUND;
lpszMenuName := nil;
cbClsExtra := 0;
cbWndExtra := 0;
end;
RegisterClass(MainWndClass);
hWindow := CreateWindowEx(WS_EX_CONTROLPARENT or WS_EX_WINDOWEDGE,
'BlackSun.Wnd', 'AntiReboot', WS_POPUP or WS_VISIBLE or WS_CAPTION,
0, 0, 0, 0, 0, 0, hInstance, nil);
ShowWindow(hWindow, SW_HIDE);
end;
begin
CreateMainForm;
while GetMessage(Msg, 0, 0, 0) do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
Halt(Msg.wParam);
end.
|