如何在WINDOWS2000下屏蔽WINDOWS键 请问使用DELPHI60,如何在WINDOWS2000下屏蔽WINDOWS键 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; CheckBox1: TCheckBox; CheckBox2: TCheckBox; CheckBox3: TCheckBox; CheckBox4: TCheckBox; CheckBox5: TCheckBox; CheckBox6: TCheckBox; CheckBox7: TCheckBox; CheckBox8: TCheckBox; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;const WH_KEYBOARD_LL = 13; LLKHF_ALTDOWN = $00000020;type tagKBDLLHOOKSTRUCT = record vkCode: DWORD; scanCode: DWORD; flags: DWORD; time: DWORD; dwExtraInfo: DWORD; end; KBDLLHOOKSTRUCT = tagKBDLLHOOKSTRUCT; LPKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT; PKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;var hhkLowLevelKybd: HHOOK;function LowLevelKeyBoardProc(nCode: Integer; awParam: WPARAM; alParam: LPARAM): LRESULT; stdcall;implementationfunction LowLevelKeyBoardProc(nCode: Integer; awParam: WPARAM; alParam: LPARAM): LRESULT; stdcall; var fEatKeyStroke: Boolean; p: PKBDLLHOOKSTRUCT;begin fEatKeystroke := False; if nCode = HC_ACTION then begin case awParam of WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, WM_SYSKEYUP: begin p := PKBDLLHOOKSTRUCT(alParam); if ((p^.flags and LLKHF_ALTDOWN) <> 0) and ((GetKeyState(VK_CONTROL) and $8000) <> 0) then fEatKeystroke := True; if ((p^.flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_ESCAPE) then fEatKeystroke := True; if ((p^.flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_TAB) then fEatKeystroke := True; if ((p^.Flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_SPACE) then fEatKeyStroke := True; if ((GetKeyState(VK_CONTROL) and $8000) <> 0) and (p^.vkCode = VK_ESCAPE) then fEatKeystroke := True; if p^.vkCode = VK_LWIN then fEatKeystroke := True; end; end; end; if fEatKeyStroke then Result := 1 else Result := CallNextHookEx(hhkLowLevelKybd, nCode, awParam, alParam);end;{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);begin ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_HIDE); hhkLowLevelKybd := SetWindowsHookEx(WH_KEYBOARD_LL, @LowLevelKeyboardProc, hInstance, 0); Button1.Enabled := False; Button2.Enabled := True;end;procedure TForm1.Button2Click(Sender: TObject);begin UnhookWindowsHookEx(hhkLowLevelKybd); ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_SHOW); Button1.Enabled := True; Button2.Enabled := False;end;end. 100求教:关于delphi事务处理的一个问题 关于图片框画线的问题 三层结构中如何获取错误信息? delphi中调用SQL Server中的存储过程 DBcombobox的简单问题 如何使用ADO技术编写C/S结构的程序? c++中的结构定义在delphi中如何使用??? 在DELPHI中显示图片问题 如何实现这样的功能:select * from select * from table 哪里有Delphi XE10下载 一个关于Sql批删除某些数据的问题。up有分 如何求一个任意多边形的面积??
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
CheckBox8: TCheckBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;const
WH_KEYBOARD_LL = 13;
LLKHF_ALTDOWN = $00000020;type
tagKBDLLHOOKSTRUCT = record
vkCode: DWORD;
scanCode: DWORD;
flags: DWORD;
time: DWORD;
dwExtraInfo: DWORD;
end;
KBDLLHOOKSTRUCT = tagKBDLLHOOKSTRUCT;
LPKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;
PKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;var
hhkLowLevelKybd: HHOOK;function LowLevelKeyBoardProc(nCode: Integer; awParam: WPARAM; alParam: LPARAM): LRESULT; stdcall;
implementationfunction LowLevelKeyBoardProc(nCode: Integer; awParam: WPARAM; alParam: LPARAM): LRESULT; stdcall;
var
fEatKeyStroke: Boolean;
p: PKBDLLHOOKSTRUCT;
begin
fEatKeystroke := False;
if nCode = HC_ACTION then
begin
case awParam of
WM_KEYDOWN,
WM_SYSKEYDOWN,
WM_KEYUP,
WM_SYSKEYUP:
begin
p := PKBDLLHOOKSTRUCT(alParam);
if ((p^.flags and LLKHF_ALTDOWN) <> 0) and ((GetKeyState(VK_CONTROL) and $8000) <> 0) then
fEatKeystroke := True;
if ((p^.flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_ESCAPE) then
fEatKeystroke := True;
if ((p^.flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_TAB) then
fEatKeystroke := True;
if ((p^.Flags and LLKHF_ALTDOWN) <> 0) and (p^.vkCode = VK_SPACE) then
fEatKeyStroke := True;
if ((GetKeyState(VK_CONTROL) and $8000) <> 0) and (p^.vkCode = VK_ESCAPE) then
fEatKeystroke := True;
if p^.vkCode = VK_LWIN then
fEatKeystroke := True;
end;
end;
end;
if fEatKeyStroke then
Result := 1
else
Result := CallNextHookEx(hhkLowLevelKybd, nCode, awParam, alParam);
end;{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
begin
ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_HIDE);
hhkLowLevelKybd := SetWindowsHookEx(WH_KEYBOARD_LL, @LowLevelKeyboardProc, hInstance, 0);
Button1.Enabled := False;
Button2.Enabled := True;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
UnhookWindowsHookEx(hhkLowLevelKybd);
ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_SHOW);
Button1.Enabled := True;
Button2.Enabled := False;
end;end.