VC++.进程路径2

CString strCurProcessPath;HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, GetCurrentProcessId());if (hProcess){TCHAR wsz[MAX_PATH] = { 0 };GetModuleFileNameEx(hProcess...

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

本文标题为:VC++.进程路径2

基础教程推荐