我想屏蔽鼠标和除了ESC以外键盘上所有的按键。用SetWindowsHookEx如何编写?给分
解决方案 »
- 求一两个显示器分屏显示的方案
- 组件设计!
- !!!!!!!!有关ADOQuery问题!!!!
- FastReport的BUG,在动态连接库中打印报表,高手请进。
- 如何去掉DELPHI7中,由ActionManager1,ActionMainMenuBar1产生的快捷键?
- 向各位大虾请教!
- bitmap image is not valid (图形转换)
- Edit控件的一个事件作用的问题???????——————在线等待!
- 如何获取提供上网服务的那台计算机的IP地址??
- Delphi异常处理
- 低级问题:如何使用ListView?
- 求用ShellExecute打开含有用户名和密码的共享目录的使用方法及探测98/ME共享密码的方法或源程序!
function HookProc(iCode:Integer;wParam:wParam;lParam:lParam):LRESULT;stdcall;
begin
Result:=0;
if iCode < 0 then begin
Result := CallNextHookEx(hHook,iCode,wParam,lParam);
exit;
end;
if (iCode = HC_ACTION) and (pEventMSG(lParam)^.message = 257) then begin //键盘放开
if pEventMSG(lParam)^.paramH = nHotKey then
if Assigned(coFFHotKey.FOnHotKey) then coFFHotKey.FOnHotKey(coFFHotKey);
end;
end;
Function TFFHotKey.OpenHotKey : Boolean;
begin
nHotKey := GetKeysInt(coFFHotKey.HotKey);
if nHotKey=0 then begin
Result := False;
exit;
end;
hHook:=SetwindowsHookEx(WH_JOURNALRECORD, HookProc ,HInstance,0); //建立键盘鼠标操作消息纪录链
Result := True;
end;Procedure TFFHotKey.CloseHotKey;
begin
UnHookWindowsHookEx(hHook);
end;