Alt+F4可另做个程序:首先声明变量为B:Boolena,代码如下: procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (ssAlt in shift) and (Key=VK_F4) then begin B:=False; FormCloseQuery(sender,B); end; end;procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if B=False then CanClose:=False else CanClose:=True; end;procedure TForm1.Button1Click(Sender: TObject); begin B:=True; Close; end;
For alt+tab: HKEY_CURRENT_USER\Control Panel and Desktop and Coolswitch 0 need reboot. For CTRL+ALT+DEL,I don't think there is anyway to disable it(UNDER NT),it's part of the security policy for NT,no way!
我曾用它写了一个“礼物”(小恶作剧)
SystemParametersInfo(SPI_SCREENSAVERRUNNING,1,nil,0);ALT+TAB,WIN键可考虑写一个键盘钩子,另外CTRL+ESC也得屏蔽吧。
其参数是什么?如何用?谢谢您!
请问为什么!
我试过上述方法并为屏蔽这个组合!
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (ssAlt in shift) and (Key=VK_F4) then
begin
B:=False;
FormCloseQuery(sender,B);
end;
end;procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if B=False then
CanClose:=False
else
CanClose:=True;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
B:=True;
Close;
end;
HKEY_CURRENT_USER\Control Panel and Desktop and Coolswitch 0
need reboot.
For CTRL+ALT+DEL,I don't think there is anyway to disable it(UNDER NT),it's part of the security policy for NT,no way!
始终不行,OS 为WIN98,编译器用BC5.02 和 VC6。
再请问一下,如果用钩子截获ALT+CTRL+DEL 消息,
代码该如何写。请多多指教。
//false: 恢复
void ExclusiveAllWindows(bool ExAw)
{
HWND hWnd = FindWindow("Shell_traywnd", "");
if(hWnd)
{
if(ExAw)
{
ShowWindow(hWnd, SW_HIDE);
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_HIDEWINDOW);
}
else
{
ShowWindow(hWnd, SW_SHOW);
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW);
}
} SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, !ExAw, "", 0);
SystemParametersInfo(SPI_SCREENSAVERRUNNING, ExAw, "", 0);
}
this function can not work normal under win97, it can work
under win98.
——更别说Ctrl+Alt+Del组合键!!!有大虾说可用Hook完成,请给出例程,必须通过NT环境检验。若此,他可以受到几乎所有人的敬仰!因为这不是小问题!!!
直接E_mail给我好吗? [email protected]