08 2012 档案
摘要:#include <Tlhelp32.h>#include <windows.h>#include <iostream>#include <iomanip>#include <map>#include <string>using namespace std;map<DWORD, wstring> GetProcessIdAndName(){ HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); PROCESSENTRY32
阅读全文
摘要:#include <Tlhelp32.h>void ListModule(DWORD pid){ HANDLE processSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid); MODULEENTRY32 me32; me32.dwSize = sizeof(MODULEENTRY32); if (Module32First(processSnap, &me32)) { do { wcout <<me32.dwSize <<endl; ...
阅读全文
摘要:GetWindowsDirectory -> c:\windows or c:\GetTempPath -> CurrentUser::%Tmp% || System::%Tmp% || CurrentUser::%Temp% || System::%Temp%SHGetKnownFolderPathDo Not use environment string for well-known directory any more, use this function instead.#include <shlobj.h>wchar_t *fullp...
阅读全文
摘要:PathFindFileNamePathFindFileName(L"c:\\windows"); // windowsPathFindFileName(L"c:\\windows\\"); // windows\PathFindFileName(L"c:"); // c:PathFindFileName(L"c:\\"); // c:\PathFindExtension/* * full path extension * c: * ...
阅读全文
摘要:BOOL IsWin7OrLater(){ // Initialization. OSVERSIONINFOEX osVerInfo = {}; osVerInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); osVerInfo.dwMajorVersion = 6; osVerInfo.dwMinorVersion = 1; // Set condition. DWORDLONG conditionMask = 0; int op = VER_GREATER_EQUAL; VER_SET_...
阅读全文