Hi,
folgende
Unit einfach ins Projekt aufnehmen:
Delphi-Quellcode:
unit KILL_AltF4;
interface
Uses
Classes, Windows, Forms;
Var
FKeyHook : HHook;
implementation
function KeyboardHook(code: Integer; wParam: WPARAM;
lParam: LPARAM): LRESULT;
stdcall;
Var
KeyboardState: TKeyboardState;
begin
GetKeyboardState(KeyboardState);
if (KeyboardStateToShiftState(KeyboardState) = [ssAlt])
and (wParam = VK_F4)
then
Result := 1
else
Result := CallNextHookEx(FKeyHook, code, wParam, lParam);
end;
initialization
FKeyHook := SetWindowsHookEx(WH_KEYBOARD, KeyboardHook, 0, GetCurrentThreadId);
finalization
UnhookWindowsHookEx(FKeyHook);
end.
Die Erweiterung um das ESC ist no problem...
Frank