How do you get the path to the WIndows desktop?
-
How do you form the filepath string to indicate you want to save a file to the desktop? I know "C:\\FOLDER\\FILE.TXT" but what is the path to the desktop? A client asked me to make a simple change to a downloadable web installer tool I wrote. It used to have a File...Save As dialog and they wanted me to change it to automatically save to the dektop. No problem! I said I'd do it for free. Delete the common dialog code, change the CFile.SetFilePath code from CCommonDialog.GetPathName to............ what? What is that magical cobination of ascii characters that tells my app to save to the desktop? TIA!
//placeholder for witty verbiage
-
How do you form the filepath string to indicate you want to save a file to the desktop? I know "C:\\FOLDER\\FILE.TXT" but what is the path to the desktop? A client asked me to make a simple change to a downloadable web installer tool I wrote. It used to have a File...Save As dialog and they wanted me to change it to automatically save to the dektop. No problem! I said I'd do it for free. Delete the common dialog code, change the CFile.SetFilePath code from CCommonDialog.GetPathName to............ what? What is that magical cobination of ascii characters that tells my app to save to the desktop? TIA!
//placeholder for witty verbiage
use
::SHGetSpecialFolderLocation
orSHGetSpecialFolderPath
function. with folder parameter asCSIDL_COMMON_DESKTOPDIRECTORY
(for all users) or asCSIDL_DESKTOP
(for currently logged in user). Functions are declared in Shlobj.h /yawar -
How do you form the filepath string to indicate you want to save a file to the desktop? I know "C:\\FOLDER\\FILE.TXT" but what is the path to the desktop? A client asked me to make a simple change to a downloadable web installer tool I wrote. It used to have a File...Save As dialog and they wanted me to change it to automatically save to the dektop. No problem! I said I'd do it for free. Delete the common dialog code, change the CFile.SetFilePath code from CCommonDialog.GetPathName to............ what? What is that magical cobination of ascii characters that tells my app to save to the desktop? TIA!
//placeholder for witty verbiage
-
use
::SHGetSpecialFolderLocation
orSHGetSpecialFolderPath
function. with folder parameter asCSIDL_COMMON_DESKTOPDIRECTORY
(for all users) or asCSIDL_DESKTOP
(for currently logged in user). Functions are declared in Shlobj.h /yawarFantastic Yawar! I googled, I searched but I never would have thought to look there :) This did the trick. Thanks.
//placeholder for witty verbiage