Quote:
Originally Posted by phx
Can somebody write an example function with it, like I did in my first post, and test if it works? Does it need "#include <windows.h>" or more?
|
Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
char* get_workdir(void) {
static char dir[MAX_PATH];
GetCurrentDirectoryA(MAX_PATH, dir);
return dir;
}
Works like it should in XP and Windows 10. If it can't convert the characters in the path to the OEM character set, it replaces them with question marks.