Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » GetHomeDirectory, GetHomeDirFile in Win32
Re: GetHomeDirectory, GetHomeDirFile in Win32 [message #10729 is a reply to message #10728] Wed, 25 July 2007 19:22 Go to previous messageGo to previous message
Zardos is currently offline  Zardos
Messages: 62
Registered: April 2007
Member
mrjt wrote on Wed, 25 July 2007 18:36

It might be a Does anyone know of a better way? Has this been done already?


For my personal requirements I have already written some functions to get the default pathes on windows (including vista) what I have found is to use the values from the registry:

HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVers ion\\Explorer\\User Shell Folders

You are probably interested in the Keys:
"Personal"
"Desktop"

...Of course I would share the code, but all this is just an ugly hack with some very specific funtions.

Basically I have the following funtions for storing configurations:
String GetConfigPath(const char*name, const char *subpath);
inline String UserConfigPath(const char *subpath = NULL) { return GetConfigPath("AppData", AppendFileName(GetExeTitle(), subpath)); }
inline String AllUserConfigPath(const char *subpath = NULL) { return GetConfigPath("Common AppData", AppendFileName(GetExeTitle(), subpath)); }
inline String AppConfigPath(const char *subpath = NULL) { return GetConfigPath("ExeConfigFilePath", subpath); }
inline String UserLocalPath(const char *subpath = NULL) { return GetConfigPath("Local AppData", AppendFileName(GetExeTitle(), subpath)); }

String UserConfigFile(const char *file = NULL, const char* subpath = NULL);
String AllUserConfigFile(const char *file = NULL, const char* subpath = NULL);
String AppConfigFile(const char *file = NULL, const char* subpath = NULL);
String UserLocalFile(const char *file = NULL, const char* subpath = NULL);


... well, probably not useful for you.

Edit: The link you mention is declared: Deprecated... I guess its better to use the registry values, and probably the usual way.

[Updated on: Wed, 25 July 2007 19:25]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DropList::NotNull implemented, fixed refreshing right button after closing popuped list
Next Topic: New simple static widget DisplayCtrl...
Goto Forum:
  


Current Time: Mon Jul 07 16:42:41 CEST 2025

Total time taken to generate the page: 0.04015 seconds