#include <iostream>
#include <ShlObj.h>

//Get Special Folders ~By DreammVB~
//Example of returning special folder locations.

using namespace std;
using std::cout;
using std::endl;

string GetSpecialFolder(int ID){
	static wchar_t path[MAX_PATH+1];
	HRESULT hr;
	hr = SHGetFolderPath(HWND_DESKTOP,ID,NULL,0,path);
	if(hr != 0){return "";}
	//Convert wide string to string
	wstring ws(path);
	//Retuurn string
	return string(ws.begin(),ws.end());

}

int main(int argc, char **anvg){
	
	cout << "AppData  : " << GetSpecialFolder(CSIDL_APPDATA).c_str() << endl;
	cout << "Cookies  : " << GetSpecialFolder(CSIDL_COOKIES).c_str() << endl;
	cout << "Windows  : " << GetSpecialFolder(CSIDL_WINDOWS).c_str() << endl;
	cout << "Desktop  : " << GetSpecialFolder(CSIDL_DESKTOP).c_str() << endl;
	//Keep console open
	system("pause");
	return 1;
}