-
January 5th, 2010, 07:44 AM
#1
Getting the user's 'My Documents' folder
Is there a simple API call to obtain the current user's 'My Documents' folder? I know about SHGetSpecialFolderLocation() but for some strange reason it requires a HWND as the first parameter (not sure if it can be NULL). I also know there are (mostly convoluted) ways of finding this info from the registry - but I just wondered if there's anything a bit more straightforward?
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
January 5th, 2010, 07:58 AM
#2
Re: Getting the user's 'My Documents' folder
SHGetSpecialFolderLocation is obsolete, use SHGetFolderPath with CSIDL_PERSONAL. hwndOwner parameter can be NULL.
-
January 5th, 2010, 07:59 AM
#3
Re: Getting the user's 'My Documents' folder
Yes, but that can be NULL. See SHGetFolderPath() also.
-
January 5th, 2010, 09:27 AM
#4
Re: Getting the user's 'My Documents' folder
Not sure if this will help as it doesn't give you the "My Documents" folder, however it can point you to the user data area...
Take a look at the environment variables:
APPDATA
HOMEDRIVE and HOMEPATH
USERPROFILE
They will point you to where the user specific items are stored.
Hope it helps.
Be sure to rate those who help!
-------------------------------------------------------------
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|