hsr////////////////////////////////////////////////////////
게시판에 보시면 키보드 훅킹에 대해서 많이나옵니다.
일걸 좀 응용하면 됩니다.
....
var
Form1: TForm1;
KeyHook: HHOOK;
function KeyboardHook(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LResult; stdcall;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
KeyHook := SetWindowsHookEx(WH_KEYBOARD, @KeyboardHook, 0, GetCurrentThreadID);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnHookWindowsHookEx(KeyHook);
end;
function KeyboardHook(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LResult;
begin
if nCode > -1 then begin
if (wParam = VK_TAB)and(GetKeyState(VK_CONTROL)<0) then begin
Result := -1;
exit;
end;
end;
Result := CallNextHookEx(KeyHook, nCode, wParam, lParam);
end;
게시판에 보시면 키보드 훅킹에 대해서 많이나옵니다.
일걸 좀 응용하면 됩니다.
....
var
Form1: TForm1;
KeyHook: HHOOK;
function KeyboardHook(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LResult; stdcall;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
KeyHook := SetWindowsHookEx(WH_KEYBOARD, @KeyboardHook, 0, GetCurrentThreadID);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
UnHookWindowsHookEx(KeyHook);
end;
function KeyboardHook(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LResult;
begin
if nCode > -1 then begin
if (wParam = VK_TAB)and(GetKeyState(VK_CONTROL)<0) then begin
Result := -1;
exit;
end;
end;
Result := CallNextHookEx(KeyHook, nCode, wParam, lParam);
end;