Txesmi is right. But SHGetKnownFolderPath is seems a bit tricky to integrate.
I used SHGetFolderPath
years ago. it no needs dll. but i'm unable to use SHGetKnownFolderPath without dll.
So, if you will follow this path, here is example for you:
plugin:
#include <wchar.h>
#include <KnownFolders.h>
#include <shlobj.h>
#include <comdef.h>
wchar_t* path = new wchar_t[128];
DLLFUNC void SHGetKnownFolderPathProgramData(char* str)
{
SHGetKnownFolderPath(FOLDERID_ProgramData, 0, NULL, &path);
_bstr_t b(path);
const char* c = b;
strcpy((char*)str, (char*)c);
}
lite-c
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <windows.h>
char* savedir_str="";
void SHGetKnownFolderPathProgramData(str);
void on_1_event()
{
SHGetKnownFolderPathProgramData(savedir_str);
printf(_chr(savedir_str));
}
void main()
{
fps_max = 60;
level_load(NULL);
}
i'm not sure my codes are totally correct. i'm just showing the way.
And here is the
sample with dll. There are two function in it. FOLDERID_LocalAppData and FOLDERID_ProgramData.
Good luck!
edit: btw, it's not for create directory, it's for get the correct directory on every pc.