K kege Unregistered / Unconfirmed GUEST, unregistred user! 2003-10-05 #1 我想在程序中加入一个功能,就是当该段代码开始执行的时候,屏蔽掉鼠标和键盘事件,使程序窗口运行不受影响。请问该如何实现?谢谢了。
桦 桦树皮 Unregistered / Unconfirmed GUEST, unregistred user! 2003-10-05 #2 在application.onmessage事件中拦截所有鼠标和键盘消息。<br>在这个事件中这样写:<br>if ((Msg.message >= WM_KEYFIRST) and (Msg.message <= WM_KEYLAST)) or<br> ((Msg.message >= WM_MOUSEFIRST) and (Msg.message <= WM_MOUSELAST))then<br>exit;
在application.onmessage事件中拦截所有鼠标和键盘消息。<br>在这个事件中这样写:<br>if ((Msg.message >= WM_KEYFIRST) and (Msg.message <= WM_KEYLAST)) or<br> ((Msg.message >= WM_MOUSEFIRST) and (Msg.message <= WM_MOUSELAST))then<br>exit;
K kege Unregistered / Unconfirmed GUEST, unregistred user! 2003-10-06 #3 这样好像只能屏蔽掉自己程序的鼠标键盘事件,但是还是可以点击其他的程序。我是想要使程序运行时,就使计算机转入像死机的的状态,鼠标键盘根本不起作用了(本程序继续执行中,鼠标还可以移动)。
S suocy5 Unregistered / Unconfirmed GUEST, unregistred user! 2003-10-07 #5 1,把窗体置为<br>brush.style:=bsClear,无边框,让它和屏幕一样大。<br>2,SystemParametersInfo 置屏保
G g2000u21 Unregistered / Unconfirmed GUEST, unregistred user! 2003-10-17 #6 function BlockInput(fBlockIt:boolean):Boolean;stdcall;external 'user32.dll';<br><br>blockinput(true);
function BlockInput(fBlockIt:boolean):Boolean;stdcall;external 'user32.dll';<br><br>blockinput(true);