Program Files special folder location.
-
How do I create a folder in the Program Files directory programatically? I haven't programmed in Win32 the last few years and don't have my win code to refresh my memory. I know it is some COM object function that gets the special location like Trash, Program Files, History.. Thanks in advance.
-
How do I create a folder in the Program Files directory programatically? I haven't programmed in Win32 the last few years and don't have my win code to refresh my memory. I know it is some COM object function that gets the special location like Trash, Program Files, History.. Thanks in advance.
LPITEMIDLIST pid; HRESULT hr; //replace 0x0026 by CSIDL_PROGRAM_FILES if you have a newer sdk. hr = SHGetSpecialFolderLocation(m_hWnd,0x0026,&pid); TCHAR path[MAX_PATH]; SHGetPathFromIDList(pid,path); //now path contains what you want. LPMALLOC mal; SHGetMalloc(&mal); mal->Free(pid);
I hope it works, and is without errors. this is this.