blob: 88c18d5edce88026491b53cf69ebff9d93a5d4d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// ProgramLocation.h
#include "StdAfx.h"
#include "ProgramLocation.h"
#include "Windows/FileName.h"
#include "Windows/DLL.h"
using namespace NWindows;
extern HINSTANCE g_hInstance;
bool GetProgramFolderPath(UString &folder)
{
if (!NDLL::MyGetModuleFileName(g_hInstance, folder))
return false;
int pos = folder.ReverseFind(L'\\');
if (pos < 0)
return false;
folder = folder.Left(pos + 1);
return true;
}
|