Get Desktop folder

Nusret Taşçı nusi at sofha.de
Tue Nov 7 02:51:48 PST 2006


> within windows I'm very confused by the microsoft documentation 
> about:

> SHGetFolderPath(...)

SHGetSpecialFolderPath() with CSIDL_DESKTOPDIRECTORY might work for you.
AFAIR, it's perfectly valid for a user to move it's desktop directory to 
somewhere else than the default path. If he moves it with explorer, than 
explorer will notice this and calls to SHGetSpecialFolderPath() will 
return the new path.

BOOL SHGetSpecialFolderPath(HWND hwndOwner,
     LPTSTR lpszPath,
     int nFolder,
     BOOL fCreate
);

CSIDL_DESKTOPDIRECTORY (0x0010)
The file system directory used to physically store file objects on the 
desktop (not to be confused with the desktop folder itself). A typical 
path is C:\Documents and Settings\username\Desktop.





More information about the wx-users mailing list