PATH.GetWinFolder |
![]() ![]() |
filename = PATH.GetWinFolder( nFileID AS INTEGER ) AS STRING
Returns the Windows folder for the specified ID. This function uses the SHGetSpecialFolderPath Windows API function to retrieve the name of Windows Special Folders.
A subset of folder IDs have been defined in MyBASIC2 ExtLib.BAS
CONST CSIDL_DESKTOP = 0x0000 CONST CSIDL_CONTROLS = 0x0003 CONST CSIDL_PRINTERS = 0x0004 CONST CSIDL_PERSONAL = 0x0005 CONST CSIDL_MYDOCUMENTS = 0x0005 CONST CSIDL_STARTUP = 0x0007 CONST CSIDL_DRIVES = 0x0011 CONST CSIDL_NETWORK = 0x0012 CONST CSIDL_APPDATA = 0x001A CONST CSIDL_LOCAL_APPDATA = 0x001C CONST CSIDL_COMMON_APPDATA = 0x0023 CONST CSIDL_WINDOWS = 0x0024 CONST CSIDL_SYSTEM = 0x0025 CONST CSIDL_PROGRAM_FILES = 0x0026 CONST CSIDL_MYPICTURES = 0x0027 CONST CSIDL_PROGRAM_FILES_COMMON = 0x002B CONST CSIDL_COMMON_DOCUMENTS = 0x002E
Example:
$LIBRARY "MyBASIC2_ExtLib.dll" $INCLUDE "MyBASIC2_ExtLib.bas"
folder = PATH.GETWINFOLDER( CSIDL_APPDATA )
PRINT "Application Data Folder = ";folder,
END
|