How do i get full path to "My Documents" dir?
-
Hello folks, just moved from unix environment into win32, not quite comfortable with the feeling that i'm a dumb yet again :( please, help! i need to get a full path to user's dir's like "My Documents". How can i do that? Just hardcoding the path "c:\\Documents and Settings\\USER_NAME_WHO_THE_HELL_KNOWS\\My Documents" is not good idea at all. And what about compatibility with different windowses (nt, xp, win2k or even win98)? any help is greatly appreciated :) alex, debug - is my life style
-
Hello folks, just moved from unix environment into win32, not quite comfortable with the feeling that i'm a dumb yet again :( please, help! i need to get a full path to user's dir's like "My Documents". How can i do that? Just hardcoding the path "c:\\Documents and Settings\\USER_NAME_WHO_THE_HELL_KNOWS\\My Documents" is not good idea at all. And what about compatibility with different windowses (nt, xp, win2k or even win98)? any help is greatly appreciated :) alex, debug - is my life style
Check out
SHGetSpecialFolder
and related functions. You can also nick the code out of my CFileSpec[^] class :) Rob Manderson http://www.mindprobes.net **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003 -
Hello folks, just moved from unix environment into win32, not quite comfortable with the feeling that i'm a dumb yet again :( please, help! i need to get a full path to user's dir's like "My Documents". How can i do that? Just hardcoding the path "c:\\Documents and Settings\\USER_NAME_WHO_THE_HELL_KNOWS\\My Documents" is not good idea at all. And what about compatibility with different windowses (nt, xp, win2k or even win98)? any help is greatly appreciated :) alex, debug - is my life style
In the specific case you mention, start here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/manage.asp[^] MSDN has compatability information on each API - you should install it from the CD/DVDs if you have them, or use the MSDN web site. -- Ian Darling "The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
-
Hello folks, just moved from unix environment into win32, not quite comfortable with the feeling that i'm a dumb yet again :( please, help! i need to get a full path to user's dir's like "My Documents". How can i do that? Just hardcoding the path "c:\\Documents and Settings\\USER_NAME_WHO_THE_HELL_KNOWS\\My Documents" is not good idea at all. And what about compatibility with different windowses (nt, xp, win2k or even win98)? any help is greatly appreciated :) alex, debug - is my life style
You can also read the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal I use this in my programs. Geraldo.
-
You can also read the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal I use this in my programs. Geraldo.
-
Ack, don't do this. Microsoft might not always place that information there. Always use the proper API calls. It is hacks like this that cause programs to break. Tim Smith I'm going to patent thought. I have yet to see any prior art.
-
Ack, don't do this. Microsoft might not always place that information there. Always use the proper API calls. It is hacks like this that cause programs to break. Tim Smith I'm going to patent thought. I have yet to see any prior art.
Oh, thanks Tim for the advice. From now on, I will use the API call.
-
You can also read the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal I use this in my programs. Geraldo.
See this[^] for a good explanation of why using that registry key is undesirable. Rob Manderson http://www.mindprobes.net **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
-
Hello folks, just moved from unix environment into win32, not quite comfortable with the feeling that i'm a dumb yet again :( please, help! i need to get a full path to user's dir's like "My Documents". How can i do that? Just hardcoding the path "c:\\Documents and Settings\\USER_NAME_WHO_THE_HELL_KNOWS\\My Documents" is not good idea at all. And what about compatibility with different windowses (nt, xp, win2k or even win98)? any help is greatly appreciated :) alex, debug - is my life style
hi, use this function call SHGetFolderPath. refer msdn for parameters. Have A Nice Day! Murali.M