当前位置:编程学习 > Delphi >>

Delphi 屏蔽系统的Ctrl+Alt+Del

从网上搜集整理,直接调用函数Run易做图CAD屏蔽Ctrl+Alt+Del,一般在程序创建时调用,在程序退出时调用Stop易做图CAD ,取消屏蔽Ctrl+Alt+Del。

 

{-----------------------------------------------------------------------------
 Unit Name: 易做图_CAD_Unit
 Author:    liubin
 Date:      2010-11-04
 Purpose:   屏蔽系统热键ctrl+alt+del、 WIN 、ALT+TAB等
 Memo:
 History:
-----------------------------------------------------------------------------}
unit 易做图_CAD_Unit;

inte易做图ce

uses Windows, TLHelp32,SysUtils,Messages;
type
  {按键消息的结构,Delphi中也没有,自己定义吧。这也就是我为什么说用C写
这样的程序更好的原因之一。还必须注意的是这个结构在Windows NT 4 sp3以上系统中才能使用}
tagKBDLLHOOKSTRUCT = packed record
  vkCode: DWORD;//虚拟键值
  scanCode: DWORD;//扫描码值(没有用过,我也不懂^_^)
  {一些扩展标志,这个值比较麻烦,MSDN上说得也不太明白,但是
  根据这个程序,这个标志值的第六位数(二进制)为1时,Alt键按下为0}
  flags: DWORD;
  time: DWORD;//消息时间戳
  dwExtraInfo: DWORD;//和消息相关的扩展信息
end;
  KBDLLHOOKSTRUCT = tagKBDLLHOOKSTRUCT;
  PKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;
//这个是低级键盘钩子的索引值,Delphi中没有,必须自己定义
const
 WH_KEYBOARD_LL = 13;
//定义一个常量好和上面那个结构中的flags比较而得出Alt键是否按下
 LLKHF_ALTDOWN = $20;    //屏蔽热键用www.zzzyk.com 
 MyKernel='SnowmanLockScreenHook.Dll';  //释放完得文件名,可以自己改
 Winlogon='winlogon.exe';
 MyKernelSize=9216;
 MyKernelBuf:Array [0..9215] of Byte =
 (
   $4D,$5A,$50,$00,$02,$00,$00,$00,$04,$00,$0F,$00,$FF,$FF,$00,$00,
   $B8,$00,$00,$00,$00,$00,$00,$00,$40,$00,$1A,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$00,$00,
   $BA,$10,$00,$0E,$1F,$B4,$09,$CD,$21,$B8,$01,$4C,$CD,$21,$90,$90,
   $54,$68,$69,$73,$20,$70,$72,$6F,$67,$72,$61,$6D,$20,$6D,$75,$73,
   $74,$20,$62,$65,$20,$72,$75,$6E,$20,$75,$6E,$64,$65,$72,$20,$57,
   $69,$6E,$33,$32,$0D,$0A,$24,$37,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $50,$45,$00,$00,$4C,$01,$03,$00,$19,$5E,$42,$2A,$00,$00,$00,$00,
   $00,$00,$00,$00,$E0,$00,$8E,$A1,$0B,$01,$02,$19,$00,$20,$00,$00,
   $00,$10,$00,$00,$00,$80,$00,$00,$70,$AB,$00,$00,$00,$90,$00,$00,
   $00,$B0,$00,$00,$00,$00,$40,$00,$00,$10,$00,$00,$00,$02,$00,$00,
   $04,$00,$00,$00,$00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00,$00,
   $00,$C0,$00,$00,$00,$10,$00,$00,$00,$00,$00,$00,$02,$00,$01,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$10,$00,$00,$10,$00,$00,
   $00,$00,$00,$00,$10,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $B0,$B0,$00,$00,$C8,$00,$00,$00,$00,$B0,$00,$00,$B0,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $78,$B1,$00,$00,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$55,$50,$58,$30,$00,$00,$00,$00,
   $00,$80,$00,$00,$00,$10,$00,$00,$00,$00,$00,$00,$00,$04,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$00,$00,$E0,
   $55,$50,$58,$31,$00,$00,$00,$00,$00,$20,$00,$00,$00,$90,$00,$00,
   $00,$1E,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$40,$00,$00,$E0,$2E,$72,$73,$72,$63,$00,$00,$00,
   $00,$10,$00,$00,$00,$B0,$00,$00,$00,$02,$00,$00,$00,$22,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$40,$00,$00,$C0,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
   $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$31,$2E,$32,$34,$00,
   $55,$50,$58,$21,$0C,$09,$02,$0A,$0A,$EF,$82,$AC,$83,$03,$D2,$AA,
   $E7,$85,$00,$00,$66,$1B,$00,$00,$00,$36,$00,$00,$26,$00,$00,$B1,
   $C8,$20,$63,$FF,$FF,$25,$00,$00,$50,$C8,$8B,$C0,$07,$C4,$C0,$20,
   $83,$0C,$32,$BC,$B8,$B4,$83,$0C,$32,$C8,$D4,$B0,$AC,$A8,$0C,$32,
   $C8,$20,$A4,$A0,$E4,$32,$C8,$20,$83,$E0,$DC,$9C,$BB,$B7,$BF,$0C,
   $98,$53,$83,$C4,$BC,$BB,$0A,$0B,$00,$54,$E8,$04,$4C,$F6,$06,$7B,
   $FB,$FF,$44,$24,$2C,$01,$74,$05,$0F,$B7,$5C,$24,$30,$8B,$C3,$1B,
   $44,$5B,$C3,$63,$94,$19,$64,$90,$41,$90,$8C,$88,$64,$90,$41,$06,
   $84,$80,$7C,$E5,$FF,$B6,$19,$78,$56,$BE,$6C,$45,$D0,$83,$3E,$00,
   $75,$3A,$68,$44,$06,$DD,$F6,$DF,$CE,$6A,$00,$B5,$C8,$85,$C9,$75,
   $05,$33,$C0,$5E,$64,$A1,$20,$CC,$FF,$FF,$FF,$F7,$89,$01,$89,

补充:软件开发 , Delphi ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,