MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / GetProgramDirectory

Function GetProgramDirectory

source/Windows/AppleWin.cpp:345–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343//===========================================================================
344
345static void GetProgramDirectory(void)
346{
347 char programDir[MAX_PATH];
348 GetModuleFileName((HINSTANCE)0, programDir, MAX_PATH);
349 programDir[MAX_PATH-1] = 0;
350
351 g_sProgramDir = programDir;
352
353 size_t loop = g_sProgramDir.size();
354 while (loop--)
355 {
356 if ((g_sProgramDir[loop] == PATH_SEPARATOR) || (g_sProgramDir[loop] == ':'))
357 {
358 g_sProgramDir.resize(loop + 1); // this reduces the size
359 break;
360 }
361 }
362}
363
364//===========================================================================
365

Callers 1

OneTimeInitializationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected