void GetProgramFilename(LPTSTR szExe, const size_t size) { GetModuleFileName(GetModuleHandle(NULL), szExe, size); } void ExampleUse() { char szExe[MAX_PATH]; GetProgramFilename(szExe, sizeof(szExe)); printf("This is %s\n", szExe); }
Programming Tips - Win32: get the program filename (exe)
Date: 2020may28
Platform: win32
OS: Windows
Language: C/C++
Q. Win32: get the program filename (exe)
A.