如何屏蔽win键,如win+d(50分)

  • 主题发起人 主题发起人 nick4309
  • 开始时间 开始时间
N

nick4309

Unregistered / Unconfirmed
GUEST, unregistred user!
如何屏蔽win键,如win+d[:(]
 
你注册win热键就可以了
有左win和右win
 
function LowLevelKeyboardProc(nCode:integer;WParam:WPARAM;LParam:LPARAM):LRESULT;stdcall;
var
fEatKeystroke:BOOL;
p:PKBDLLHOOKSTRUCT;
begin
result:=0;
fEatKeystroke := false;
p:=PKBDLLHOOKSTRUCT(lparam);
if (ncode=HC_ACTION) then
begin
case wparam of
WM_KEYDOWN,
WM_SYSKEYDOWN,
WM_KEYUP,
WM_SYSKEYUP:
featkeystroke :=(p.vkcode = VK_Lwin) or (p.vkcode = VK_Rwin)or (p.vkcode = VK_apps);
end;
end;
if featkeystroke = true then
result:=1;
if ncode <> 0 then
result := callnexthookex(0,ncode,wparam,lparam);
end;

procedure form1.lock;
begin
hhklowlevelkybd := setwindowshookexw(wh_keyboard_ll,LowlevelKeyboardproc,hinstance,0);
end;

锁住左右win键和application键,win98/nt/2000/xp都可以
 
谢谢风之彼端
 
hhklowlevelkybd := setwindowshookexw(wh_keyboard_ll,LowlevelKeyboardproc,hinstance,0);

我写上述代码,怎么不能运行?
提示:
[Error] Unit1.pas(42): Incompatible types: 'regular procedure and method pointer'
 
后退
顶部