#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
DWORD WINAPI mouse(LPVOID lpParameter)
{
srand(time(0));
while (1)
{
HWND window = GetConsoleWindow();
SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
return 0L;
}
int main(){
string s;
//打开符号链接
HANDLE hDevice = CreateFile("\\\\.\\TDKeybd", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (GetLastError()) {
if(GetLastError() == ERROR_FILE_NOT_FOUND){
printf("%s","解驱动键盘锁:驱动未安装");
}else{
printf("解驱动键盘锁:设置失败");
}
cout<<"\n";
}
BOOL bEnable = TRUE;
//发送控制代码
if (DeviceIoControl(hDevice, 0x220000, &bEnable, 4, NULL, 0, NULL, NULL))
printf("解驱动键盘锁:设置成功");
else
printf("解驱动键盘锁:设置失败");
CloseHandle(hDevice);
cout<<"\n";
HANDLE hThread = CreateThread(NULL, 0, mouse, NULL, 0, NULL);
cout<< "Microsoft Windows [版本 10.0.19045.3324]\n(c) Microsoft Corporation。保留所有权利。\n\n";
while(1){
cout<<"C:\\Users\\HP\\Desktop>";
getline(cin,s);
if(s=="cmd"){
cout<< "Microsoft Windows [版本 10.0.19045.3324]\n(c) Microsoft Corporation。保留所有权利。\n\n";
}else if(s=="kill")
{
system("TASKKILL /F /IM StudentMain.exe /T");
}else{
system(s.c_str());
}
}
}
上面的代码就是一个cmd,但是是专门针对极域的,他会自动置顶,并且解除极域键盘锁,并且输入kill就可以快速杀除极域,希望大家赞+关注+收藏,谢谢。