On desktop Windows, there is functions to retrieve the special folders:
- GetWindowsDirectory()
- GetSystemDirectory()
I can't find any for the PPC. I would like to know if there is an equivalent or if I can assume it is always "\windows". What about non-english PPCs?
Some imporant directories (\Programs for example)will have different names depending on the language of the target device. The windows dir. seems to always be called like that though, as i have seen code from compact/hp with only that path hardcoded and the others retrieved in some language dependant way.
cryo
See SHGetSpecialFolderLocation and SHGetPathFromIDList. I could not get the windows dir directly, but extracted it from some other path (like the fonts path, which is in \windows).
Dan East
Thanks Dan. SHGetSpecialFolderPath() will return the \windows directory.
Why oh why did they have to add a "SH" in front of it, that's why I couldn't find it. I could also blame the help system.
Thanks!
What is the ID for the windows folder? The API reference I have does not list an ID for the windows folder.
All I see is:
CSIDL_BITBUCKET
CSIDL_CONTROLS
CSIDL_DESKTOP
CSIDL_DESKTOPDIRECTORY
CSIDL_DRIVES
CSIDL_FAVORITES
CSIDL_FONTS
CSIDL_NETHOOD
CSIDL_NETWORK
CSIDL_PERSONAL
CSIDL_PRINTERS
CSIDL_PROGRAMS
CSIDL_RECENT
CSIDL_SENDTO
CSIDL_STARTMENU
CSIDL_STARTUP
CSIDL_TEMPLATES
In shellapi.h it only has these:
// supported SHGetSpecialFolderPath nFolder ids
#define CSIDL_DESKTOP 0x0000
#define CSIDL_PROGRAMS 0x0002
#define CSIDL_PERSONAL 0x0005
#define CSIDL_STARTUP 0x0007
#define CSIDL_RECENT 0x0008
#define CSIDL_FONTS 0x0014
#define CSIDL_FAVORITES 0x0016
Dan East
My eVC4.0 docs say:
CSIDL_WINDOWS 0x0024 The Windows folder.
Okay, then that's something that was added after eVC 3.0. Sometime I'll try calling SHGetSpecialFolderLocation with 0x24. If it works then it wouldn't be the first time something was accidentally omitted from the headers and docs.
Dan East
I don't know about SHGetSpecialFolderLocation, it isn't listed there. The docs lists it for SHGetSpecialFolderPath.