系统相关
首页 > 系统相关> > VC++.进程路径2

VC++.进程路径2

作者:互联网

CString 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);
}

标签:PROCESS,MAX,路径,TCHAR,C++,strCurProcessPath,进程,wsz,hProcess
来源: https://www.cnblogs.com/dailycode/p/12896613.html