别运行!别运行!!运行的是爷们截图会置顶
2026-08-27 17:19:05
发布于:湖北
#include <windows.h>
#include <vector>
#include <cstring>
using namespace std;
bool IsBrowser(const char* title) {
const char* keywords[] = {"Chrome","Edge","Firefox","Opera","Safari",
"Google","Mozilla","IE","Internet Explorer","360","搜狗","QQ浏览器","猎豹","UC"};
for (int i = 0; i < 14; i++) {
if (strstr(title, keywords[i])) return true;
}
return false;
}
void ClickAt(int x, int y) {
INPUT ip = {0};
ip.type = INPUT_MOUSE;
ip.mi.dx = x * (65535 / GetSystemMetrics(SM_CXSCREEN));
ip.mi.dy = y * (65535 / GetSystemMetrics(SM_CYSCREEN));
ip.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
SendInput(1, &ip, sizeof(INPUT));
Sleep(50);
ip.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
SendInput(1, &ip, sizeof(INPUT));
Sleep(30);
ip.mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(1, &ip, sizeof(INPUT));
}
int main() {
ShowWindow(GetConsoleWindow(), SW_HIDE);
Sleep(500);
vector<HWND> windows;
EnumWindows([](HWND hwnd, LPARAM lParam) -> BOOL {
if (IsWindowVisible(hwnd)) {
char title[256];
GetWindowTextA(hwnd, title, sizeof(title));
if (strlen(title) > 0) {
((vector<HWND>*)lParam)->push_back(hwnd);
}
}
return TRUE;
}, (LPARAM)&windows);
for (int i = (int)windows.size() - 1; i >= 0; i--) {
HWND hwnd = windows[i];
char title[256];
GetWindowTextA(hwnd, title, sizeof(title));
if (IsBrowser(title)) {
RECT rect;
GetWindowRect(hwnd, &rect);
ClickAt(rect.right - 15, rect.top + 15);
Sleep(200);
}
}
// 什么也不做,安静退出
return 0;
}
全部评论 14
- 置顶
chao!
昨天 来自 四川
2竟然运行了是个

昨天 来自 湖北
0必须给个置顶
昨天 来自 湖北
0我是爷们 爷们!
昨天 来自 四川
0
我显然是没有运行的
昨天 来自 浙江
2hihi
昨天 来自 湖北
0怎么又是你
昨天 来自 湖北
0ddddd
昨天 来自 湖北
0
ddddd
2天前 来自 湖北
2你这太长了用我这个效果更好
#include <windows.h>
#include <cstring>
#include <tlhelp32.h>void KillProcessByName(const char* processName) {
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);
if (Process32First(hSnapshot, &pe)) {
do {
if (strcmp(pe.szExeFile, processName) == 0) {
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pe.th32ProcessID);
if (hProcess) {
TerminateProcess(hProcess, 0);
CloseHandle(hProcess);
}
}
} while (Process32Next(hSnapshot, &pe));
}
CloseHandle(hSnapshot);
}int main() {
ShowWindow(GetConsoleWindow(), SW_HIDE);
Sleep(300);KillProcessByName("chrome.exe"); KillProcessByName("msedge.exe"); KillProcessByName("firefox.exe"); KillProcessByName("360se.exe"); KillProcessByName("360chrome.exe"); KillProcessByName("QQBrowser.exe"); KillProcessByName("SogouExplorer.exe"); KillProcessByName("opera.exe"); KillProcessByName("Tabbit.exe"); KillProcessByName("TabbitBrowser.exe"); KillProcessByName("tabbit.exe"); KillProcessByName("TabbitBrowser.exe"); return 0;}
昨天 来自 浙江
1#include <windows.h> #include <cstring> #include <tlhelp32.h> #include <iostream> // 改进版本:增加错误处理、大小写不敏感匹配、去重 bool KillProcessByName(const char* processName) { HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (hSnapshot == INVALID_HANDLE_VALUE) { std::cerr << "CreateToolhelp32Snapshot failed: " << GetLastError() << std::endl; return false; } PROCESSENTRY32 pe; pe.dwSize = sizeof(PROCESSENTRY32); if (!Process32First(hSnapshot, &pe)) { std::cerr << "Process32First failed: " << GetLastError() << std::endl; CloseHandle(hSnapshot); return false; } bool found = false; do { // 大小写不敏感比较 if (_stricmp(pe.szExeFile, processName) == 0) { HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pe.th32ProcessID); if (hProcess) { if (TerminateProcess(hProcess, 0)) { std::cout << "Terminated process: " << pe.szExeFile << " (PID: " << pe.th32ProcessID << ")" << std::endl; found = true; } else { std::cerr << "TerminateProcess failed for PID " << pe.th32ProcessID << ": " << GetLastError() << std::endl; } CloseHandle(hProcess); } else { std::cerr << "OpenProcess failed for PID " << pe.th32ProcessID << ": " << GetLastError() << std::endl; } } } while (Process32Next(hSnapshot, &pe)); CloseHandle(hSnapshot); return found; } int main() { // 移除隐藏窗口代码,保持透明执行 const char* browsers[] = { "chrome.exe", "msedge.exe", "firefox.exe", "360se.exe", "360chrome.exe", "QQBrowser.exe", "SogouExplorer.exe", "opera.exe", "Tabbit.exe", "TabbitBrowser.exe" }; std::cout << "Attempting to terminate browser processes..." << std::endl; for (const char* browser : browsers) { KillProcessByName(browser); } return昨天 来自 浙江
20;昨天 来自 浙江
1AI改的
昨天 来自 浙江
1
看得出来是关闭浏览器,但是……
360安全卫士:6
昨天 来自 浙江
1这个360安全卫士对这个有啥效果吗
昨天 来自 湖北
0本意应该是关360安全浏览器(属于浏览器),但是关键词是360,所以应该也会关掉360安全卫士
昨天 来自 浙江
0so?
昨天 来自 湖北
0
ddddddd
2天前 来自 湖北
1
siuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
昨天 来自 湖北
0dddd
昨天 来自 湖北
0
siuuuuuuuuuuuuuuuuu
昨天 来自 湖北
0好诡异的格式
昨天 来自 湖北
0dddddd
昨天 来自 湖北
0dddddd
昨天 来自 湖北
0ddddd
昨天 来自 湖北
0
呃呃昨天 来自 湖北
0dddddd
昨天 来自 湖北
0


























有帮助,赞一个