?? unit1.pas
字號:
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//作者 :黎富平
//網(wǎng)上呢稱:聰聰
//Home Page :http://www.soft520.com
//E-Mail :admin@soft520.com
//日期 :2004-8-23
//功能 :根據(jù)BCB_FANS(四大名捕之追殺令)在2000下屏蔽Ctrl + Alt + Del組合鍵的
// 技術(shù),在Borland C++Builder 6.0 Patch4下編寫遠程線程注入的代碼,封裝
// 成DLL并輸出EnabledKey和DisabledKey兩個函數(shù),使得可以在Delphi,VB等程
// 中可以使用,本程序在Windows Server 2003中文版平臺下面測試通過
//輸出格式: EnabledKey: function (DllFileName: PChar): BOOL; stdcall;
// DisabledKey: function (DllFileName: PChar): BOOL; stdcall;
//開發(fā)語言:Borland C++Builder 6.0 Patch4
//鳴謝 :BCB_FANS(四大名捕之追殺令)
//版權(quán) :轉(zhuǎn)載請注明原作者:)
// :以下為 BCB_FANS(四大名捕之追殺令)在2000下屏蔽Ctrl + Alt + Del組合鍵的
// 技術(shù)說明
//原理 :采用遠程線程注入技術(shù),裝載一個DLL到Winlogon進程,然后截獲SAS窗口的窗
// 口過程,接管WM_HOTKEY消息,以達到屏蔽Ctrl + Alt + Del之目的。
//技術(shù)比較:關(guān)于在2000下面如何屏蔽Ctrl + Alt + Del組合鍵,一種常被提到的解決方法就
// 是使用自己寫的GINA去替換MSGINA.DLL,然后在WlxLoggedOnSAS里邊直接返回
// WLX_SAS_ACTION_NONE。嘿嘿,說到底這并不是真正地屏蔽了這個組合鍵,只是
// 直接返回WLX_SAS_ACTION_NONE時,Winlogon進程又自動從"Winlogon"桌面切換
// 回原來的"Default"桌面了,而不是顯示安全對話框,所以看起來被屏蔽了:),
// 使用那種方法明顯地看到桌面在閃爍!但是使用本文的方法時,你不會看到任
// 何閃爍!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
DllHandle: Cardinal;
DllFileName: PChar;
public
{ Public declarations }
end;
var
Form1: TForm1;
EnabledKey: function (DllFileName: PChar): BOOL; stdcall;
DisabledKey: function (DllFileName: PChar): BOOL; stdcall;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
DllHandle := LoadLibrary('RunDLL.dll');
DllFileName := PChar(ExtractFilePath(Application.ExeName )+'SASHOOK.dll');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FreeLibrary(DllHandle);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if DllHandle <> 0 then
begin
EnabledKey := GetProcAddress(DllHandle, 'EnabledKey');
if @EnabledKey <> nil then
begin
if EnabledKey(DllFileName) then
ShowMessage('成功屏蔽');
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if DllHandle <> 0 then
begin
DisabledKey := GetProcAddress(DllHandle, 'DisabledKey');
if @DisabledKey <> nil then
begin
if DisabledKey(DllFileName) then
ShowMessage('解除成功');
end;
end;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -