udfShGetFolderPath
str udfShGetFolderPath (int, int)
;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfShGetFolderPath (CSIDL, dwFlags)
strPath = ""
intPathSize = (260 + 1) * 2 ; Size of null-terminated string of length MAX_PATH = 260.
pszPath = BinaryAlloc (intPathSize)
BinaryEodSet (pszPath, intPathSize)
hToken = 0
; hToken = -1 ; Default User.
intResult = DllCall ("SHELL32.DLL", long : "SHGetFolderPathW", lpnull, long : CSIDL, long : hToken, long : dwFlags, lpbinary : pszPath)
Select intResult
Case 0 ; S_OK = 0 ; Success.
   strPath = BinaryPeekStrW (pszPath, 0, intPathSize)
   strPath = strPath : StrSub ("\", (StrSub (strPath, StrLen (strPath), 1) != "\"), 1) ; AddBackslash
   Break
   ;   Case 1 ; S_FALSE = 1 ; The CSIDL is valid, but the folder does not exist.
   ;      strPath = "N/A The CSIDL is valid, but the folder does not exist." ; or strPath = ""
   ;      Break
   ;   Case - 2147024809 ; E_INVALIDARG = -2147024809 ; 0x80070057; The CSIDL is not valid.
   ;      strPath = "N/A The CSIDL is not valid." ; or strPath = ""
   ;      Break
EndSelect
pszPath = BinaryFree (pszPath)
Return strPath
;..........................................................................................................................................
; This UDF "udfShGetFolderPath" gets the path of a folder identified by a CSIDL (deprecated).
; As of Windows Vista, the function SHGetKnownFolderPath should be used.
;
; Parameters:
;
; CSIDL .......... A CSIDL value that identifies the folder whose path is to be retrieved (0..255).
; dwFlags = 0  ... SHGFP_TYPE_CURRENT = 0 ; Retrieve the folder's current path.
; dwFlags = 1  ... SHGFP_TYPE_DEFAULT = 1 ; Retrieve the folder's default path.
;
;..........................................................................................................................................
; Note:
; CSIDL_FLAG_CREATE = 32768 ; Force creation of folder ; 0x8000
; Combine with another CSIDL to force the creation of the associated folder if it does not exist.
;..........................................................................................................................................
; Note:
; hToken
; Microsoft Windows 2000 and earlier: Always set this parameter to NULL.
; Windows XP and later: This parameter is usually set to NULL, but you might need to assign a non-NULL value to hToken
; for those folders that can have multiple users but are treated as belonging to a single user.
; The most commonly used folder of this type is Documents.
; Assigning the hToken parameter a value of -1 indicates the Default User.
; This enables clients of SHGetFolderPath to find folder locations (such as the Desktop folder) for the Default User.
; The Default User user profile is duplicated when any new user account is created, and includes special folders such as My Documents and Desktop.
; Any items added to the Default User folder also appear in any new user account.
;..........................................................................................................................................
; Ansi version:
; intResult = DllCall ("SHELL32.DLL", long : "SHGetFolderPathA", lpnull, long : CSIDL, long : hToken, long : dwFlags, lpbinary : pszPath)
;..........................................................................................................................................
; For older systems that require the redistributable SHFolder.dll:
; intResult = DllCall ("SHFOLDER.DLL", long : "SHGetFolderPathW", lpnull, long : CSIDL, long : hToken, long : dwFlags, lpbinary : pszPath)
;..........................................................................................................................................
; Detlev Dalitz.20020716.20100213.
;..........................................................................................................................................
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


; Test.

; Create special folder "My Videos".
CSIDL_MYVIDEO = 14
CSIDL_FLAG_CREATE = 32768
strSpecialFolder = udfShGetFolderPath (CSIDL_MYVIDEO | CSIDL_FLAG_CREATE, 0)
Pause ("Special folder created ...", strSpecialFolder)


; Get list of known folders at your machine.
strList = ""
For intCSIDL = 0 To 255
   strFolderPathDefault = udfShGetFolderPath (intCSIDL, 0) ; Default.
   strFolderPathCurrent = udfShGetFolderPath (intCSIDL, 1) ; Current.
   If strFolderPathDefault != "" Then strList = strList : @CRLF : intCSIDL : @TAB : "Def " : @TAB : strFolderPathDefault : @CRLF : intCSIDL : @TAB : "Cur " : @TAB : strFolderPathCurrent
Next
ClipPut (strList)

wEndOfFile ()
wPaste ()

Exit

;==========================================================================================================================================
; Example from Windows XP.
;
;    0   Def    C:\Dokumente und Einstellungen\Admin\Desktop\
;    0   Cur    C:\Dokumente und Einstellungen\Default User\Desktop\
;    2   Def    C:\Dokumente und Einstellungen\Default User\Startmenü\Programme\
;    2   Cur    C:\Dokumente und Einstellungen\Default User\Startmenü\Programme\
;    6   Def    C:\Dokumente und Einstellungen\Default User\Favoriten\
;    6   Cur    C:\Dokumente und Einstellungen\Default User\Favoriten\
;    7   Def    C:\Dokumente und Einstellungen\Default User\Startmenü\Programme\Autostart\
;    7   Cur    C:\Dokumente und Einstellungen\Default User\Startmenü\Programme\Autostart\
;    8   Def    C:\Dokumente und Einstellungen\Default User\Recent\
;    8   Cur    C:\Dokumente und Einstellungen\Default User\Recent\
;    9   Def    C:\Dokumente und Einstellungen\Default User\SendTo\
;    9   Cur    C:\Dokumente und Einstellungen\Default User\SendTo\
;   11   Def    C:\Dokumente und Einstellungen\Default User\Startmenü\
;   11   Cur    C:\Dokumente und Einstellungen\Default User\Startmenü\
;   16   Def    C:\Dokumente und Einstellungen\Default User\Desktop\
;   16   Cur    C:\Dokumente und Einstellungen\Default User\Desktop\
;   19   Def    C:\Dokumente und Einstellungen\Default User\Netzwerkumgebung\
;   19   Cur    C:\Dokumente und Einstellungen\Default User\Netzwerkumgebung\
;   20   Def    C:\WINDOWS\Fonts\
;   20   Cur    C:\WINDOWS\Fonts\
;   21   Def    C:\Dokumente und Einstellungen\Default User\Vorlagen\
;   21   Cur    C:\Dokumente und Einstellungen\Default User\Vorlagen\
;   22   Def    C:\Dokumente und Einstellungen\All Users\Startmenü\
;   22   Cur    C:\Dokumente und Einstellungen\All Users\Startmenü\
;   23   Def    C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\
;   23   Cur    C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\
;   24   Def    C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Autostart\
;   24   Cur    C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Autostart\
;   25   Def    C:\Dokumente und Einstellungen\All Users\Desktop\
;   25   Cur    C:\Dokumente und Einstellungen\All Users\Desktop\
;   26   Def    C:\Dokumente und Einstellungen\Default User\Anwendungsdaten\
;   26   Cur    C:\Dokumente und Einstellungen\Default User\Anwendungsdaten\
;   27   Def    C:\Dokumente und Einstellungen\Default User\Druckumgebung\
;   27   Cur    C:\Dokumente und Einstellungen\Default User\Druckumgebung\
;   28   Def    C:\Dokumente und Einstellungen\Default User\Lokale Einstellungen\Anwendungsdaten\
;   28   Cur    C:\Dokumente und Einstellungen\Default User\Lokale Einstellungen\Anwendungsdaten\
;   31   Def    C:\Dokumente und Einstellungen\All Users\Favoriten\
;   31   Cur    C:\Dokumente und Einstellungen\All Users\Favoriten\
;   32   Def    C:\Dokumente und Einstellungen\Default User\Lokale Einstellungen\Temporary Internet Files\
;   32   Cur    C:\Dokumente und Einstellungen\Default User\Lokale Einstellungen\Temporary Internet Files\
;   33   Def    C:\Dokumente und Einstellungen\Default User\Cookies\
;   33   Cur    C:\Dokumente und Einstellungen\Default User\Cookies\
;   34   Def    C:\Dokumente und Einstellungen\Default User\Lokale Einstellungen\Verlauf\
;   34   Cur    C:\Dokumente und Einstellungen\Default User\Lokale Einstellungen\Verlauf\
;   35   Def    C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\
;   35   Cur    C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\
;   36   Def    C:\WINDOWS\
;   36   Cur    C:\WINDOWS\
;   37   Def    C:\WINDOWS\system32\
;   37   Cur    C:\WINDOWS\system32\
;   38   Def    C:\Programme\
;   38   Cur    C:\Programme\
;   40   Def    C:\Dokumente und Einstellungen\Admin\
;   40   Cur    C:\Dokumente und Einstellungen\Default User\
;   41   Def    C:\WINDOWS\system32\
;   41   Cur    C:\WINDOWS\system32\
;   43   Def    C:\Programme\Gemeinsame Dateien\
;   43   Cur    C:\Programme\Gemeinsame Dateien\
;   45   Def    C:\Dokumente und Einstellungen\All Users\Vorlagen\
;   45   Cur    C:\Dokumente und Einstellungen\All Users\Vorlagen\
;   46   Def    C:\Dokumente und Einstellungen\All Users\Dokumente\
;   46   Cur    C:\Dokumente und Einstellungen\All Users\Dokumente\
;   47   Def    C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Verwaltung\
;   47   Cur    C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Verwaltung\
;   53   Def    C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Musik\
;   53   Cur    C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Musik\
;   54   Def    C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Bilder\
;   54   Cur    C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Bilder\
;   55   Def    C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Videos\
;   55   Cur    C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Videos\
;   56   Def    C:\WINDOWS\resources\
;   56   Cur    C:\WINDOWS\resources\
;   57   Def    C:\WINDOWS\resources\0407\
;   57   Cur    C:\WINDOWS\resources\0407\
;
;==========================================================================================================================================
; Description of CSIDL values.
;
;   Name
;    CSIDL code
;    Meaning
;    Description
;
;   Desktop
;    0
;    CSIDL_DESKTOP
;    Desktop (namespace root)
;
;
;    1
;    CSIDL_INTERNET
;    Internet Virtual Folder
;
;   Programs
;    2
;    CSIDL_PROGRAMS
;    Programs folder (under Start menu in [user] profile)
;
;
;    3
;    CSIDL_CONTROLS
;    Control Panel virtual folder
;
;
;    4
;    CSIDL_PRINTERS
;    Printers virtual folder
;
;   Personal
;    5
;    CSIDL_PERSONAL
;    Personal folder ([user] profile)
;
;   Favorites
;    6
;    CSIDL_FAVORITES
;    Favorites folder ([user] profile)
;
;   Startup
;    7
;    CSIDL_STARTUP
;    Startup folder ([user] profile)
;
;   Recent
;    8
;    CSIDL_RECENT
;    Recent folder ([user] profile)
;
;   SendTo
;    9
;    CSIDL_SENDTO
;    SendTo folder ([user] profile)
;
;
;    10
;    CSIDL_BITBUCKET
;    Recycle Bin folder
;
;   Start Menu
;    11
;    CSIDL_STARTMENU
;    Start menu ([user] profile)
;
;   My Music
;    13
;    CSIDL_MYMUSIC
;    My Music ([user] profile)
;
;   My Video
;    14
;    CSIDL_MYVIDEO
;    My Videos  ([user] profile)
;
;
;    16
;    CSIDL_DESKTOPDIRECTORY
;    Desktop folder ([user] profile)
;
;
;    17
;    CSIDL_DRIVES
;    My Computer virtual folder
;
;
;    18
;    CSIDL_NETWORK
;    Network Neighborhood root
;
;   NetHood
;    19
;    CSIDL_NETHOOD
;    Network Neighborhood directory
;
;   Fonts
;    20
;    CSIDL_FONTS
;    Fonts virtual folder
;
;   Templates
;    21
;    CSIDL_TEMPLATES
;    Templates folder ([user] profile)
;
;   Common Start Menu
;    22
;    CSIDL_COMMON_STARTMENU
;    Start menu (All Users profile)
;
;   Common Programs
;    23
;    CSIDL_COMMON_PROGRAMS
;    Programs folder (under Start menu in All Users profile)
;
;   Common Startup
;    24
;    CSIDL_COMMON_STARTUP
;    Startup folder (All Users profile)
;
;   Common Desktop
;    25
;    CSIDL_COMMON_DESKTOPDIRECTORY
;    Desktop folder (All Users profile)
;
;   AppData
;    26
;    CSIDL_APPDATA
;    Application Data ([user] profile)
;
;   PrintHood
;    27
;    CSIDL_PRINTHOOD
;    PrintHood folder ([user] profile)
;
;   Local AppData
;    28
;    CSIDL_LOCAL_APPDATA
;    Local (non-roaming) data repository for apps
;
;
;    29
;    CSIDL_ALTSTARTUP
;    Alternate Startup ([user], DBCS)
;
;
;    30
;    CSIDL_COMMON_ALTSTARTUP
;    Alternate Startup folder (All Users profile, DBCS)
;
;   Common Favorites
;    31
;    CSIDL_COMMON_FAVORITES
;    Favorites folder (All Users profile)
;
;   Cache
;    32
;    CSIDL_INTERNET_CACHE
;    Internet Cache folder
;
;   Cookies
;    33
;    CSIDL_COOKIES
;    Cookies folder
;
;   History
;    34
;    CSIDL_HISTORY
;    History folder
;
;   Common AppData
;    35
;    CSIDL_COMMON_APPDATA
;    Application Data (All Users Profile)
;
;
;    36
;    CSIDL_WINDOWS
;    Windows directory or SYSROOT
;
;
;    37
;    CSIDL_SYSTEM
;    System folder
;
;
;    38
;    CSIDL_PROGRAM_FILES
;    Program Files folder
;
;   My Pictures
;    39
;    CSIDL_MYPICTURES
;    My Pictures folder
;
;
;    40
;    CSIDL_PROFILE
;    Users profile folder
;
;
;    41
;    CSIDL_SYSTEM
;    System folder
;
;
;    43
;    CSIDL_PROGRAMS_FILES_COMMON
;    Common files folder, e.g., C:\Program Files\Common Files
;
;   Common Templates
;    45
;    CSIDL_COMMON_TEMPLATES
;    Templates folder (All Users profile)
;
;   Common Documents
;    46
;    CSIDL_COMMON_DOCUMENTS
;    Documents folder (All Users profile)
;
;   Common Administrative Tools
;    47
;    CSIDL_COMMON_ADMINTOOLS
;    Admin Tools folder (All Users profile)
;
;   Administrative Tools
;    48
;    CSIDL_ADMINTOOLS
;    Admin Tools folder
;
;   CommonMusic
;    53
;    CSIDL_COMMON_MUSIC
;    My Music (All Users profile)
;
;   CommonPictures
;    54
;    CSIDL_COMMON_PICTURES
;    My Pictures (All Users profile)
;
;   CommonVideo
;    55
;    CSIDL_COMMON_VIDEO
;    My Videos (All Users profile)
;
;
;    56
;    CSIDL_RESOURCES
;    Windows resources folder
;
;   CD Burning
;    59
;    CSIDL_CDBURN_AREA
;    The file system directory acting as a staging area for files waiting to be written to CD.
;    A typical path is C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\CD Burning.
;
;
;    69
;    CSIDL_PHOTOALBUMS
;    Windows Vista and later. The virtual folder used to store photo albums, typically username\My Pictures\Photo Albums.
;
;==========================================================================================================================================
;   "current"2010 Microsoft Corporation. All rights reserved.
;
;   SHGetFolderPath Function
;   Deprecated. Gets the path of a folder identified by a CSIDL [
;   http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ] value.
;
;   Note  As of Windows Vista, this function is merely a wrapper for SHGetKnownFolderPath [
;   http://msdn.microsoft.com/en-us/library/bb762188(VS.85).aspx ] . The CSIDL value is translated to
;   its associated KNOWNFOLDERID [ http://msdn.microsoft.com/en-us/library/bb762584(VS.85).aspx ] and
;   then SHGetKnownFolderPath is called. New applications should use the known folder system rather
;   than the older CSIDL system, which is supported only for backward compatibility.
;
;
;   Syntax
;
;   HRESULT SHGetFolderPath(
;       HWND hwndOwner,
;       int nFolder,
;       HANDLE hToken,
;       DWORD dwFlags,
;       LPTSTR pszPath
;   );
;
;
;   Parameters
;
;   hwndOwner
;   [in] Reserved.
;   nFolder
;   [in] A CSIDL [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ] value that identifies
;   the folder whose path is to be retrieved. Only real folders are valid. If a virtual folder is
;   specified, this function fails. You can force creation of a folder by combining the folder's CSIDL
;   with CSIDL_FLAG_CREATE.
;   hToken
;   [in] An access token [ http://msdn.microsoft.com/en-us/library/Aa374909(VS.85).aspx ] that can be
;   used to represent a particular user.
;   Microsoft Windows 2000 and earlier: Always set this parameter to NULL.
;
;   Windows XP and later: This parameter is usually set to NULL, but you might need to assign a
;   non-NULL value to hToken for those folders that can have multiple users but are treated as
;   belonging to a single user. The most commonly used folder of this type is Documents.
;
;   The calling process is responsible for correct impersonation when hToken is non-NULL. The calling
;   process must have appropriate security privileges for the particular user, including TOKEN_QUERY
;   and TOKEN_IMPERSONATE, and the user's registry hive must be currently mounted. See Access Control [
;   http://msdn.microsoft.com/en-us/library/Aa374860(VS.85).aspx ] for further discussion of access
;   control issues.
;
;   Assigning the hToken parameter a value of -1 indicates the Default User. This enables clients of
;   SHGetFolderPath to find folder locations (such as the Desktop folder) for the Default User. The
;   Default User user profile is duplicated when any new user account is created, and includes special
;   folders such as My Documents and Desktop. Any items added to the Default User folder also appear in
;   any new user account.
;
;   dwFlags
;   [in] Flags that specify the path to be returned. This value is used in cases where the folder
;   associated with a KNOWNFOLDERID [ http://msdn.microsoft.com/en-us/library/bb762584(VS.85).aspx ]
;   (or CSIDL) can be moved, renamed, redirected, or roamed across languages by a user or
;   administrator.
;   The known folder system that underlies SHGetFolderPath allows users or administrators to redirect a
;   known folder to a location that suits their needs. This is achieved by calling
;   IKnownFolderManager::Redirect [ http://msdn.microsoft.com/en-us/library/bb761746(VS.85).aspx ] ,
;   which sets the "restore defaults" value of the folder associated with the SHGFP_TYPE_CURRENT flag.
;
;   The default value of the folder, which is the location of the folder if a user or administrator had
;   not redirected it elsewhere, is retrieved by specifying the SHGFP_TYPE_DEFAULT flag. This value can
;   be used to implement a "C:\Users\user name\Music" feature for a known folder.
;
;   For example, the default value (SHGFP_TYPE_DEFAULT) for FOLDERID_Music [
;   http://msdn.microsoft.com/en-us/library/bb762584(VS.85).aspx ] (CSIDL_MYMUSIC [
;   http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ] ) is "D:\Music". If
;   the folder was redirected, the current value (SHGFP_TYPE_CURRENT) might be "New Doc.txt". If the
;   folder has not been redirected, then SHGFP_TYPE_DEFAULT and SHGFP_TYPE_CURRENT retrieve the same
;   path.
;
;   SHGFP_TYPE_CURRENT
;   Retrieve the folder's current path.
;   SHGFP_TYPE_DEFAULT
;   Retrieve the folder's default path.
;   pszPath
;   [out] A pointer to a null-terminated string of length MAX_PATH which will receive the path. If an
;   error occurs or S_FALSE is returned, this string will be empty.
;
;   Return Value
;
;   Returns S_OK if successful, or an error value otherwise, including the following.
;
;   S_FALSE SHGetFolderPathA only. The CSIDL in nFolder is valid, but the folder does not exist. Note
;   that the failure code is different for the ANSI and Unicode versions of this function.
;   E_FAIL SHGetFolderPathW only. The CSIDL in nFolder is valid, but the folder does not exist. Note
;   that the failure code is different for the ANSI and Unicode versions of this function.
;   E_INVALIDARG The CSIDL in nFolder is not valid.
;
;   Remarks
;
;   This function is a superset of SHGetSpecialFolderPath [
;   http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx ] , included with earlier versions of
;   the Shell. On systems that preceded those that include Shell32.dll version 5.0 (Windows Millennium
;   Edition (Windows Me) and Windows 2000), SHGetFolderPath was obtained through SHFolder.dll,
;   distributed with Microsoft Internet Explorer 4.0 and later versions. SHFolder.dll always calls the
;   current platform's version of this function. If that fails, it tries to simulate the appropriate
;   behavior. SHFolder.dll continues to be included for backward compatibility, but the function is now
;   implemented in Shell32.dll.
;
;   Note  On older systems that require the redistributable SHFolder.dll, you must explicitly link to
;   SHFolder.lib before you link to Shell32.lib.
;   Only some CSIDL values are supported, including the following:
;
;   CSIDL_ADMINTOOLS [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_APPDATA [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_COMMON_ADMINTOOLS [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_COMMON_APPDATA [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_COMMON_DOCUMENTS [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_COOKIES [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_FLAG_CREATE [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_FLAG_DONT_VERIFY [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_HISTORY [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_INTERNET_CACHE [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_LOCAL_APPDATA [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_MYPICTURES [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_PERSONAL [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_PROGRAM_FILES [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_PROGRAM_FILES_COMMON [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_SYSTEM [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   CSIDL_WINDOWS [ http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx ]
;   Example
;
;   The following code example uses SHGetFolderPath to find or create a folder and then creates a file in it.
;
;   Copy Code TCHAR szPath[MAX_PATH];
;
;   if(SUCCEEDED(SHGetFolderPath(NULL,
;                                CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
;                                NULL,
;                                0,
;                                szPath)))
;   {
;       PathAppend(szPath, TEXT());
;       HANDLE hFile = CreateFile(szPath, ...);
;   }Function Information
;
;   Minimum DLL Version shell32.dll version 5.0 or later
;   Custom Implementation No
;   Header shlobj.h
;   Import library shell32.lib
;   Minimum operating systems Windows 95 with Internet Explorer 5.0, Windows 98 with Internet Explorer
;   5.0, Windows 98 Second Edition (SE), Windows NT 4.0 with Internet Explorer 5.0, Windows NT 4.0 with
;   Service Pack 4 (SP4)
;   Unicode Implemented as ANSI and Unicode versions.
;
;   See Also
;
;   IKnownFolder::GetPath [ http://msdn.microsoft.com/en-us/library/bb761762(VS.85).aspx ]
;   Tags:
;
;
;   Community Content Parameter hToken and dwFlags     Last Edit 5:04 PM by Christian.Wimmer
;
;   If you are using the function from SHFolder.dll:
;   Parameter hToken and dwFlags are ignored in the ANSI version of the function. They always become
;   zero (0).
;==========================================================================================================================================