DWORD WINAPI GetModuleFileNameEx(This will load the path of the currently running exe file into a buffer named path.
HANDLE hProcess, // handle to a process
HMODULE hModule, // handle to a module
LPTSTR lpFilename, // receives file path
DWORD nSize // length of lpFilename
);
#include <psapi.h>
char path[MAXPATH];
GetModuleFileNameEx(GetCurrentProcess(), NULL, path, MAXPATH);
No comments:
Post a Comment