当前位置:网站首页>Disable Ctrl + Alt + Del
Disable Ctrl + Alt + Del
2022-04-23 18:52:00 【Brick Porter】
BOOL DisableCTRL_ALT_DEL(bool bDisable)
{
if (bDisable==suspend)
return FALSE;
//bDisable ? Suspend(_WinLoginPid) : Resume(_WinLoginPid);
typedef DWORD(WINAPI* NtProcessAPI)(HANDLE ProcessHandle);
HMODULE h_module = LoadLibrary(L"ntdll.dll");
if (!h_module)
return FALSE;
NtProcessAPI _NtResumeProcess = (NtProcessAPI)GetProcAddress(h_module, bDisable ? "NtSuspendProcess" : "NtResumeProcess");
if (_NtResumeProcess)
{
HANDLE ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, _WinLoginPid);
if (ProcessHandle)
{
_NtResumeProcess(ProcessHandle);
CloseHandle(ProcessHandle);
}
}
suspend = bDisable;
FreeLibrary(h_module);
return TRUE;
}
explain :bDisable Record whether you are disabled for a member variable .
_WinLoginPid Return values for the following functions .
DWORD GetWinLoginPID()
{
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(pe32);
HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
DWORD PID = 0;
BOOL bNext = ::Process32First(hProcessSnap, &pe32);
while (bNext)
{
if (wcscmp(pe32.szExeFile, L"winlogon.exe") == 0)
{
PID = pe32.th32ProcessID;
break;
}
bNext = ::Process32Next(hProcessSnap, &pe32);
}
::CloseHandle(hProcessSnap);
return PID;
}
This method has defects :
1、 Because it hung up winlogon, This is the key process of the system , It will affect the system function , So when you exit the program, you must restore it .
2、 After exiting the program, the key combination will still be processed .
Another way is to inject winlogon Take over message processing by yourself , The risk will be greater , Easy to use, system problems . If you have a lot of testing machines, you can try .
版权声明
本文为[Brick Porter]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210603257648.html
边栏推荐
- 教你用简单几个步骤快速重命名文件夹名
- Machine learning theory (8): model integration ensemble learning
- Setting up keil environment of GD single chip microcomputer
- Get a list of recent apps
- 程序员如何快速开发高质量的代码?
- iptables初探
- Can filter
- WebView opens H5 video and displays gray background or black triangle button. Problem solved
- Screenshot using projectmediamanager
- QT excel operation summary
猜你喜欢

使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA

PyGame tank battle

STM32: LCD display

os_ authent_ Prefix

Simple use of navigation in jetpack

Setting up keil environment of GD single chip microcomputer

Eight bit binary multiplier VHDL

Teach you to quickly rename folder names in a few simple steps

Download xshell 6 and xftp6 official websites

ESP32 LVGL8. 1 - textarea text area (textarea 26)
随机推荐
机器学习实战 -朴素贝叶斯
根据快递单号查询物流查询更新量
实战业务优化方案总结---主目录---持续更新
12个例子夯实promise基础
RPM package management
Configure iptables
7、 DOM (Part 2) - chapter after class exercises and answers
QT curve / oscilloscope customplot control
SQL中函数 decode()与 replace()的用法
Advanced transfer learning
ESP32 LVGL8. 1 - checkbox (checkbox 23)
Implementation of TCP UDP communication with golang language
ESP32 LVGL8. 1 - slider slider (slider 22)
Summary of actual business optimization scheme - main directory - continuous update
ESP32 LVGL8. 1 - roller rolling (roller 24)
mysql_linux版本的下载及安装详解
With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate
WebView opens H5 video and displays gray background or black triangle button. Problem solved
【历史上的今天】4 月 23 日:YouTube 上传第一个视频;网易云音乐正式上线;数字音频播放器的发明者出生
Can filter