//屏蔽和解锁 procedure TForm1.Button1Click(Sender: TObject); var Reg:TRegistry; begin Reg:=TRegistry.Create; try Reg.RootKey:=HKEY_CURRENT_USER; if Reg.OpenKey('\software\microsoft\windows\currentversion\policies\system',true) then Reg.Writebool('disabletaskmgr',True); ShowMessage('任务管理器锁定成功!'); ShellExeCute(Handle,nil,'TaskMgr.exe',nil,nil,SW_Normal); except Reg.Free; ShowMessage('任务管理器锁定失败!'); end; end;procedure TForm1.Button2Click(Sender: TObject); var Reg:TRegistry; begin Reg:=TRegistry.Create; try Reg.RootKey:=HKEY_CURRENT_USER; if Reg.OpenKey('\software\microsoft\windows\currentversion\policies\system',true) then Reg.Writebool('disabletaskmgr',False); ShowMessage('任务管理器解锁成功!'); ShellExeCute(Handle,nil,'TaskMgr.exe',nil,nil,SW_Normal); except Reg.Free; ShowMessage('任务管理器解锁失败!'); end; end;
谁可以做个通用的gina.dll出来,用注册表项来控制是否屏蔽热键。造福人民啊。
又一個gins問題!?! delphi寫gina變更windows登錄機制,需要的朋友請加:[email protected],幫忙測試bug,目前已知遠端桌面連接時會死機!procedure WlxUseCtrlAltDel (hWlx: HANDLE);stdcall; begin I.WlxUseCtrlAltDel(hWlx); end; function WlxSetOption(hWlx: HANDLE; Option: DWORD; Value: ULONG_PTR; var OldValue: ULONG_PTR) : BOOL; stdcall; begin Result:=i.WlxSetOption(hWlx,Option,Value,OldValue); end;
又一個gins問題!?! delphi寫gina變更windows登錄機制,需要的朋友請加:[email protected],幫忙測試bug,目前已知遠端桌面連接時會死機!procedure WlxUseCtrlAltDel (hWlx: HANDLE);stdcall; begin I.WlxUseCtrlAltDel(hWlx); end; function WlxSetOption(hWlx: HANDLE; Option: DWORD; Value: ULONG_PTR; var OldValue: ULONG_PTR) : BOOL; stdcall; begin Result:=i.WlxSetOption(hWlx,Option,Value,OldValue); end;
方法一:(寫gina部分代碼) function WlxLoggedOutSAS(pWlxContext: pointer; dwSasType: DWORD; pAuthenticationId: PLUID; pLogonSid: PSID; var pdwOptions: DWORD; var phToken: HANDLE; var pNprNotifyInfo: WlX_MPR_NOTIFY_INFO; out pProfile: pointer): integer; stdcall; begin result := I.WlxLoggedOutSAS(pWlxContext, dwSasType, pAuthenticationId, pLogonSid, pdwOptions, phToken, pNprNotifyInfo, pProfile); end;function WlxActivateUserShell(pWlxContext: pointer; pszDesktopName: PWideChar; pszMprLogonScript: PWideChar; pEnvironment: pointer): BOOL; stdcall; begin result := I.WlxActivateUserShell(pWlxContext, pszDesktopName, pszMprLogonScript, pEnvironment); end;function WlxLoggedOnSAS(pWlxContext: pointer; dwSasType: DWORD; pReserved: pointer): integer; stdcall; begin result := I.WlxLoggedOnSAS(pWlxContext, dwSasType, pReserved); end;procedure WlxDisplayLockedNotice(pWlxContext: pointer); stdcall; begin I.WlxDisplayLockedNotice(pWlxContext); end;function WlxWkstaLockedSAS(pWlxContext: pointer; dwSasType: DWORD): integer; stdcall; begin result := I.WlxWkstaLockedSAS(pWlxContext, dwSasType); end;function WlxIsLockOk(pWlxContext: pointer): BOOL; stdcall; begin result := I.WlxIsLockOk(pWlxContext); end;function WlxIsLogoffOk(pWlxContext: pointer): BOOL; stdcall; begin result := I.WlxIsLogoffOK(pWlxContext); end;procedure WlxLogoff(pWlxContext: pointer); stdcall; begin I.WlxLogoff(pWlxContext); end;procedure WlxShutdown(pWlxContext: pointer; ShutdownType: DWORD); stdcall; begin I.WlxShutdown(pWlxContext, ShutdownType); end;function WlxScreenSaverNotify(pWlxContext: pointer; var pSecure: BOOL): BOOL; stdcall; begin result := I.WlxScreenSaverNotify(pWlxContext, pSecure); end;function WlxStartApplication(pWlxContext: pointer; pszDesktopName: PWideChar; pEnvironment: pointer; pszCmdLine: PWideChar): BOOL; stdcall; begin result := I.WlxStartApplication(pWlxContext, pszDesktopName, pEnvironment, pszCmdLine); end;function WlxNetworkProviderLoad(pWlxContext: pointer; var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO): BOOL; stdcall; begin result := I.WlxNetworkProviderLoad(pWlxContext, pNprNotifyInfo); end;function WlxDisplayStatusMessage(pWlxContext: pointer; hDesktop: HDESK; dwOptions: DWORD; pTitle: PWideChar; pMessage: PWideChar): BOOL; stdcall; begin result := I.WlxDisplayStatusMessage(pWlxContext, hDesktop, dwOptions, pTitle, pMessage); end;function WlxGetStatusMessage(pWlxContext: pointer; var pdwOptions: DWORD; pMessage: PWideChar; dwBufferSize: DWORD): BOOL; stdcall; begin result := I.WlxGetStatusMessage(pWlxContext, pdwOptions, pMessage, dwBufferSize); end;function WlxRemoveStatusMessage(pWlxContext: pointer): BOOL; stdcall; begin result := I.WlxRemoveStatusMessage(pWlxContext); end;function WlxGetConsoleSwitchCredentials(pWlxContext: pointer; pCredInfo: pointer): BOOL; stdcall; begin result := I.WlxGetConsoleSwitchCredentials(pWlxContext, pCredInfo); end;procedure WlxReconnectNotify(pWlxContext: pointer); stdcall; begin I.WlxReconnectNotify(pWlxContext); end;procedure WlxDisconnectNotify(pWlxContext: pointer); stdcall; begin I.WlxDisconnectNotify(pWlxContext); end;type TInitKMGinaProc = function : IKMGinaIntF;var HModule: Handle;function LoadDLL: Handle; var DLLName: string; begin DLLName := GetReplDLLName; result := LoadLibrary(PChar(DLLName)); end;procedure ExecProc(HModule: Handle; ProcName: PChar; var I: IKMGinaIntF); var DLLName: string; Init: TInitKMGinaProc; begin if HModule <> 0 then begin init := GetProcAddress(HModule, ProcName); if Assigned(init) then I := Init() else raise Exception.createFmt(KMGinaErrorLoadInitProc, [DllName]); end else raise Exception.createFmt(KMGinaErrorLoadDLL, [DllName]); end;procedure InitKMGina(var I: IKMGinaIntF); begin try HModule := LoadDLL; ExecProc(HModule, 'InitKMGina', I); finally // DeleteGinaKey; end; end;procedure EndKMGina(var I: IKMGinaIntF); begin ExecProc(HModule, 'EndKMGina', I); FreeLibrary(HModule); end;方法二:(c/s結構) 注入代码(需管理员權限)發送屏蔽Alt+Ctrl+Del按键命令(消息)
现在就看你的了^_^
这个还是用GINA做比较好
procedure TForm1.Button1Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
try
Reg.RootKey:=HKEY_CURRENT_USER;
if Reg.OpenKey('\software\microsoft\windows\currentversion\policies\system',true) then
Reg.Writebool('disabletaskmgr',True);
ShowMessage('任务管理器锁定成功!');
ShellExeCute(Handle,nil,'TaskMgr.exe',nil,nil,SW_Normal);
except
Reg.Free;
ShowMessage('任务管理器锁定失败!');
end;
end;procedure TForm1.Button2Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
try
Reg.RootKey:=HKEY_CURRENT_USER;
if Reg.OpenKey('\software\microsoft\windows\currentversion\policies\system',true) then
Reg.Writebool('disabletaskmgr',False);
ShowMessage('任务管理器解锁成功!');
ShellExeCute(Handle,nil,'TaskMgr.exe',nil,nil,SW_Normal);
except
Reg.Free;
ShowMessage('任务管理器解锁失败!');
end;
end;
又一個gins問題!?!
delphi寫gina變更windows登錄機制,需要的朋友請加:[email protected],幫忙測試bug,目前已知遠端桌面連接時會死機!procedure WlxUseCtrlAltDel (hWlx: HANDLE);stdcall;
begin
I.WlxUseCtrlAltDel(hWlx);
end;
function WlxSetOption(hWlx: HANDLE; Option: DWORD; Value: ULONG_PTR; var OldValue: ULONG_PTR) : BOOL; stdcall;
begin
Result:=i.WlxSetOption(hWlx,Option,Value,OldValue);
end;
又一個gins問題!?!
delphi寫gina變更windows登錄機制,需要的朋友請加:[email protected],幫忙測試bug,目前已知遠端桌面連接時會死機!procedure WlxUseCtrlAltDel (hWlx: HANDLE);stdcall;
begin
I.WlxUseCtrlAltDel(hWlx);
end;
function WlxSetOption(hWlx: HANDLE; Option: DWORD; Value: ULONG_PTR; var OldValue: ULONG_PTR) : BOOL; stdcall;
begin
Result:=i.WlxSetOption(hWlx,Option,Value,OldValue);
end;
方法一:(寫gina部分代碼)
function WlxLoggedOutSAS(pWlxContext: pointer; dwSasType: DWORD; pAuthenticationId: PLUID; pLogonSid: PSID; var pdwOptions: DWORD; var phToken: HANDLE; var pNprNotifyInfo: WlX_MPR_NOTIFY_INFO; out pProfile: pointer): integer; stdcall;
begin
result := I.WlxLoggedOutSAS(pWlxContext, dwSasType, pAuthenticationId, pLogonSid, pdwOptions, phToken, pNprNotifyInfo, pProfile);
end;function WlxActivateUserShell(pWlxContext: pointer; pszDesktopName: PWideChar; pszMprLogonScript: PWideChar; pEnvironment: pointer): BOOL; stdcall;
begin
result := I.WlxActivateUserShell(pWlxContext, pszDesktopName, pszMprLogonScript, pEnvironment);
end;function WlxLoggedOnSAS(pWlxContext: pointer; dwSasType: DWORD; pReserved: pointer): integer; stdcall;
begin
result := I.WlxLoggedOnSAS(pWlxContext, dwSasType, pReserved);
end;procedure WlxDisplayLockedNotice(pWlxContext: pointer); stdcall;
begin
I.WlxDisplayLockedNotice(pWlxContext);
end;function WlxWkstaLockedSAS(pWlxContext: pointer; dwSasType: DWORD): integer; stdcall;
begin
result := I.WlxWkstaLockedSAS(pWlxContext, dwSasType);
end;function WlxIsLockOk(pWlxContext: pointer): BOOL; stdcall;
begin
result := I.WlxIsLockOk(pWlxContext);
end;function WlxIsLogoffOk(pWlxContext: pointer): BOOL; stdcall;
begin
result := I.WlxIsLogoffOK(pWlxContext);
end;procedure WlxLogoff(pWlxContext: pointer); stdcall;
begin
I.WlxLogoff(pWlxContext);
end;procedure WlxShutdown(pWlxContext: pointer; ShutdownType: DWORD); stdcall;
begin
I.WlxShutdown(pWlxContext, ShutdownType);
end;function WlxScreenSaverNotify(pWlxContext: pointer; var pSecure: BOOL): BOOL; stdcall;
begin
result := I.WlxScreenSaverNotify(pWlxContext, pSecure);
end;function WlxStartApplication(pWlxContext: pointer; pszDesktopName: PWideChar; pEnvironment: pointer; pszCmdLine: PWideChar): BOOL; stdcall;
begin
result := I.WlxStartApplication(pWlxContext, pszDesktopName, pEnvironment, pszCmdLine);
end;function WlxNetworkProviderLoad(pWlxContext: pointer; var pNprNotifyInfo: WLX_MPR_NOTIFY_INFO): BOOL; stdcall;
begin
result := I.WlxNetworkProviderLoad(pWlxContext, pNprNotifyInfo);
end;function WlxDisplayStatusMessage(pWlxContext: pointer; hDesktop: HDESK; dwOptions: DWORD; pTitle: PWideChar; pMessage: PWideChar): BOOL; stdcall;
begin
result := I.WlxDisplayStatusMessage(pWlxContext, hDesktop, dwOptions, pTitle, pMessage);
end;function WlxGetStatusMessage(pWlxContext: pointer; var pdwOptions: DWORD; pMessage: PWideChar; dwBufferSize: DWORD): BOOL; stdcall;
begin
result := I.WlxGetStatusMessage(pWlxContext, pdwOptions, pMessage, dwBufferSize);
end;function WlxRemoveStatusMessage(pWlxContext: pointer): BOOL; stdcall;
begin
result := I.WlxRemoveStatusMessage(pWlxContext);
end;function WlxGetConsoleSwitchCredentials(pWlxContext: pointer; pCredInfo: pointer): BOOL; stdcall;
begin
result := I.WlxGetConsoleSwitchCredentials(pWlxContext, pCredInfo);
end;procedure WlxReconnectNotify(pWlxContext: pointer); stdcall;
begin
I.WlxReconnectNotify(pWlxContext);
end;procedure WlxDisconnectNotify(pWlxContext: pointer); stdcall;
begin
I.WlxDisconnectNotify(pWlxContext);
end;type
TInitKMGinaProc = function : IKMGinaIntF;var
HModule: Handle;function LoadDLL: Handle;
var DLLName: string;
begin
DLLName := GetReplDLLName;
result := LoadLibrary(PChar(DLLName));
end;procedure ExecProc(HModule: Handle; ProcName: PChar; var I: IKMGinaIntF);
var
DLLName: string;
Init: TInitKMGinaProc;
begin
if HModule <> 0 then
begin
init := GetProcAddress(HModule, ProcName);
if Assigned(init) then
I := Init()
else
raise Exception.createFmt(KMGinaErrorLoadInitProc, [DllName]);
end
else
raise Exception.createFmt(KMGinaErrorLoadDLL, [DllName]);
end;procedure InitKMGina(var I: IKMGinaIntF);
begin
try
HModule := LoadDLL;
ExecProc(HModule, 'InitKMGina', I);
finally
// DeleteGinaKey;
end;
end;procedure EndKMGina(var I: IKMGinaIntF);
begin
ExecProc(HModule, 'EndKMGina', I);
FreeLibrary(HModule);
end;方法二:(c/s結構)
注入代码(需管理员權限)發送屏蔽Alt+Ctrl+Del按键命令(消息)