Right, sorted... Using Visual C++ Express and the Vista Windows SDK, I've come up with this:-
The whole solution is here to pick over (including an exe):-
http://www.syntaxbomb.com/ftp/dabz/ProgramData.zip
EDIT: Now, I know sod all about MinGW and its inner workings, so if anyone can build on this, great! ;)
Dabz
//ProgramData thing #include <windows.h> #include <shlobj.h> #include <iostream> #include <stdlib.h> using namespace std; int main(void) { HRESULT hr; LPWSTR pStringOut = NULL; char *folderPath = new char[1000]; hr = SHGetKnownFolderPath(FOLDERID_ProgramData,0, NULL,&pStringOut); if ( SUCCEEDED(hr) ) { cout << "Folder found:-\n\n"; WideCharToMultiByte(CP_ACP, 0, (LPWSTR)pStringOut, -1,folderPath, 1000, NULL, NULL); cout << folderPath << "\n"; } system("PAUSE"); }
The whole solution is here to pick over (including an exe):-
http://www.syntaxbomb.com/ftp/dabz/ProgramData.zip
EDIT: Now, I know sod all about MinGW and its inner workings, so if anyone can build on this, great! ;)
Dabz