function KeyboardHookHandler(iCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
implementation
hKeyboardHookProc: HHOOK;
function KeyboardHookHandler(iCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
const
_KeyPressMask = $80000000;
begin
Result := 0;
if iCode < 0 Then
begin
Result := CallNextHookEx(hKeyboardHookProc, iCode, wParam, lParam);
Exit;
end;
if ((lParam and _KeyPressMask) = 0) and (GetKeyState(VK_MENU) < 0) and (wParam = 115) then
begin
//判断输入的键值,调用相应的处理函数.
Result := 1; //返回1,系统将不再处理.
end;
end;