知道如何利用api来锁定键盘吗,我想知api的函数(10分)

  • 主题发起人 主题发起人 visual_cjiajia
  • 开始时间 开始时间
V

visual_cjiajia

Unregistered / Unconfirmed
GUEST, unregistred user!
知道如何利用api来锁定键盘吗,我想知api的函数
 
我不记得有这个键盘 api,如果在 win9x 下,可以直接使用汇编语言 in/out 屏蔽键盘。<br>或者可以尝试使用 hook,吃掉特定消息。<br>
 
var<br>tmp:integer;<br>begin<br>&nbsp; &nbsp; tmp := 0;<br>&nbsp; &nbsp; //屏蔽 Alt-Tab 查看其它,可以看到很多信息;<br>&nbsp; &nbsp; SystemParametersInfo( SPI_SETFASTTASKSWITCH, 1, @tmp, 0);<br>&nbsp; &nbsp; //屏蔽 Ctrl-Alt-Del<br>&nbsp; &nbsp; SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @tmp, 0);<br>end;<br><br><br>Or<br>procedure Tmainform.Lockkey(lock: boolean);<br>begin<br>&nbsp; if lock = true then<br>&nbsp; begin<br>&nbsp; &nbsp; asm &nbsp; &nbsp;//封锁20端口 锁定键盘 98&amp;95<br>&nbsp; &nbsp; IN AL,21H<br>&nbsp; &nbsp; OR AL,02H<br>&nbsp; &nbsp; OUT 21H,AL<br>&nbsp; &nbsp; end;<br>&nbsp; end<br>&nbsp; else<br>&nbsp; begin<br>&nbsp; &nbsp; asm &nbsp; &nbsp; //解锁20端口 解锁键盘<br>&nbsp; &nbsp; IN AL,21H<br>&nbsp; &nbsp; AND AL,0FDH<br>&nbsp; &nbsp; OUT 21H,AL<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>end; <br>
 
后退
顶部