VC++.进程路径2
2021-01-21 05:15
标签:pen proc info ssid getc str and process ++ VC++.进程路径2 标签:pen proc info ssid getc str and process ++ 原文地址:https://www.cnblogs.com/dailycode/p/12896613.htmlCString strCurProcessPath;
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, GetCurrentProcessId());
if (hProcess)
{
TCHAR wsz[MAX_PATH] = { 0 };
GetModuleFileNameEx(hProcess, 0, wsz, (MAX_PATH - 1) * sizeof(TCHAR));
strCurProcessPath = wsz;
CloseHandle(hProcess);
}