vdfsplat / AppSrc / vwin32fh.h @ 67
History | View | Annotate | Download (34.9 KB)
| 1 | 2 | wil | //TH-Header
|
|---|---|---|---|
| 2 | //*****************************************************************************************
|
||
| 3 | // Copyright (c) 2004 KURANT Project
|
||
| 4 | // All rights reserved.
|
||
| 5 | //
|
||
| 6 | // $FileName : G:\Projects\vWin32fh\vWin32fh.h
|
||
| 7 | // $ProjectName : Windows 32 bits file handling
|
||
| 8 | // $Authors : Wil van Antwerpen
|
||
| 9 | // $Created : 19.02.2004 19:25
|
||
| 10 | // $Type : BSD (as in do with it whatever you like)
|
||
| 11 | //
|
||
| 12 | // Contents:
|
||
| 13 | // This file contains the Windows API external function call definitions and
|
||
| 14 | // constants as they are used in the vWin32fh package.
|
||
| 15 | //*****************************************************************************************
|
||
| 16 | //TH-RevisionStart
|
||
| 17 | //TH-RevisionEnd
|
||
| 18 | |||
| 19 | Define CS_DDE_ERR_FILE_NOT_FOUND For "The specified file was not found.\n"
|
||
| 20 | Define CS_DDE_ERR_PATH_NOT_FOUND For "The specified path was not found.\n"
|
||
| 21 | Define CS_DDE_ERR_BAD_FORMAT For "The .EXE file is invalid.\n"
|
||
| 22 | Define CS_DDE_ERR_ACCESSDENIED For "The operating system denied access to the specified file.\n"
|
||
| 23 | Define CS_DDE_ERR_ASSOCINCOMPLETE For "The filename association is incomplete or invalid.\n"
|
||
| 24 | Define CS_DDE_ERR_DDEBUSY For "The DDE transaction could not be completed because other DDE\ntransactions were being processed.\n"
|
||
| 25 | Define CS_DDE_ERR_DDEFAIL For "The DDE transaction failed.\n"
|
||
| 26 | Define CS_DDE_ERR_DDETIMEOUT For "The DDE transaction could not be completed,\nbecause the request timed out.\n"
|
||
| 27 | Define CS_DDE_ERR_DLLNOTFOUND For "The specified dynamic-link library was not found.\n"
|
||
| 28 | Define CS_DDE_ERR_NOASSOC For "There is no application associated with the given filename extension.\n"
|
||
| 29 | Define CS_DDE_ERR_OOM For "There is not enough free memory available to complete the operation.\n"
|
||
| 30 | Define CS_DDE_ERR_PNF For "The specified path was not found.\n"
|
||
| 31 | Define CS_DDE_ERR_SHARE For "A sharing violation occurred.\n"
|
||
| 32 | Define CS_DDE_ERR_UNKNOWN_LINE1 For "Unknown DDE-error occurred.\nErrornumber"
|
||
| 33 | Define CS_DDE_ERR_UNKNOWN_LINE2 For ".\n"
|
||
| 34 | Define CS_DDE_ERR_HANDL_PAKTC For "\nPress a key to continue...\n\n"
|
||
| 35 | 9 | wil | Define CS_DDE_ERR_HANDL_CAPTION For "a DDE-error occurred"
|
| 36 | 2 | wil | |
| 37 | |||
| 38 | Define vMax_Path For |CI260 |
||
| 39 | Define vMinChar For |CI$80
|
||
| 40 | Define vMaxChar For |CI$7F
|
||
| 41 | Define vMinShort For |CI$8000
|
||
| 42 | Define vMaxShort For |CI$7FFF
|
||
| 43 | Define vMinLong For |CI$80000000
|
||
| 44 | Define vMaxLong For |CI$7FFFFFFF
|
||
| 45 | Define vMaxByte For |CI$FF |
||
| 46 | Define vMaxWord For |CI$FFFF |
||
| 47 | Define vMaxDword For |CI$FFFFFFFF |
||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | // For FindFirstFile
|
||
| 52 | Define vINVALID_HANDLE_VALUE For |CI-1
|
||
| 53 | Define vINVALID_FILE_SIZE For |CI$FFFFFFFF |
||
| 54 | Define vERROR_NO_MORE_FILES For |CI18 |
||
| 55 | |||
| 56 | 9 | wil | // The defines below can be used to find out what kind of error has occurred if
|
| 57 | 2 | wil | // the API-call ShellExecute is used.
|
| 58 | Define vERROR_FILE_NOT_FOUND For |CI0002 |
||
| 59 | Define vERROR_PATH_NOT_FOUND For |CI0003 |
||
| 60 | Define vERROR_BAD_FORMAT For |CI0011 |
||
| 61 | Define vSE_ERR_ACCESSDENIED For |CI0005 |
||
| 62 | Define vSE_ERR_ASSOCINCOMPLETE For |CI0027 |
||
| 63 | Define vSE_ERR_DDEBUSY For |CI0030 |
||
| 64 | Define vSE_ERR_DDEFAIL For |CI0029 |
||
| 65 | Define vSE_ERR_DDETIMEOUT For |CI0028 |
||
| 66 | Define vSE_ERR_DLLNOTFOUND For |CI0032 |
||
| 67 | Define vSE_ERR_FNF For |CI0002 |
||
| 68 | Define vSE_ERR_NOASSOC For |CI0031 |
||
| 69 | Define vSE_ERR_OOM For |CI0008 |
||
| 70 | Define vSE_ERR_PNF For |CI0003 |
||
| 71 | Define vSE_ERR_SHARE For |CI0026 |
||
| 72 | |||
| 73 | |||
| 74 | // C-Structure
|
||
| 75 | //typedef struct _browseinfo {
|
||
| 76 | // HWND hwndOwner;
|
||
| 77 | // LPCITEMIDLIST pidlRoot;
|
||
| 78 | // LPSTR pszDisplayName;
|
||
| 79 | // LPCSTR lpszTitle;
|
||
| 80 | // UINT ulFlags;
|
||
| 81 | // BFFCALLBACK lpfn;
|
||
| 82 | // LPARAM lParam;
|
||
| 83 | // int iImage;
|
||
| 84 | //} BROWSEINFO, *PBROWSEINFO, *LPBROWSEINFO;
|
||
| 85 | |||
| 86 | //declare C structure struct_browseinfo
|
||
| 87 | //as documented in MSDN under Windows Shell API
|
||
| 88 | Type vtBrowseInfo |
||
| 89 | Field vtBrowseInfo.hWndOwner as Handle |
||
| 90 | Field vtBrowseInfo.pIDLRoot as Pointer |
||
| 91 | Field vtBrowseInfo.pszDisplayName as Pointer |
||
| 92 | Field vtBrowseInfo.lpszTitle as Pointer |
||
| 93 | Field vtBrowseInfo.ulFlags as dWord |
||
| 94 | Field vtBrowseInfo.lpfnCallback as Pointer |
||
| 95 | Field vtBrowseInfo.lParam as dWord |
||
| 96 | Field vtBrowseInfo.iImage as dWord |
||
| 97 | End_Type // tBrowseInfo
|
||
| 98 | |||
| 99 | // Browsing for directory.
|
||
| 100 | Define vBIF_RETURNONLYFSDIRS For |CI$0001 // For finding a folder to start document searching |
||
| 101 | Define vBIF_DONTGOBELOWDOMAIN For |CI$0002 // For starting the Find Computer |
||
| 102 | Define vBIF_STATUSTEXT For |CI$0004 // Includes a status area in the dialog box. |
||
| 103 | // The callback function can set the status text by
|
||
| 104 | // sending messages to the dialog box.
|
||
| 105 | Define vBIF_RETURNFSANCESTORS For |CI$0008 // Only returns file system ancestors. |
||
| 106 | |||
| 107 | Define vBIF_BROWSEFORCOMPUTER For |CI$1000 // Browsing for Computers. |
||
| 108 | Define vBIF_BROWSEFORPRINTER For |CI$2000 // Browsing for Printers |
||
| 109 | |||
| 110 | // message from browser
|
||
| 111 | //Define BFFM_INITIALIZED 1
|
||
| 112 | //Define BFFM_SELCHANGED 2
|
||
| 113 | |||
| 114 | // messages to browser
|
||
| 115 | //Define BFFM_SETSTATUSTEXT (WM_USER + 100)
|
||
| 116 | //Define BFFM_ENABLEOK (WM_USER + 101)
|
||
| 117 | //Define BFFM_SETSELECTION (WM_USER + 102)
|
||
| 118 | |||
| 119 | |||
| 120 | External_function vWin32_SHBrowseForFolder "SHBrowseForFolder" shell32.dll ;
|
||
| 121 | Pointer lpsBrowseInfo Returns dWord |
||
| 122 | |||
| 123 | External_function vWin32_SHGetPathFromIDList "SHGetPathFromIDList" shell32.dll ;
|
||
| 124 | Pointer pidList Pointer lpBuffer Returns dWord |
||
| 125 | |||
| 126 | External_function vWin32_CoTaskMemFree "CoTaskMemFree" ole32.dll Pointer pV Returns Integer
|
||
| 127 | |||
| 128 | |||
| 129 | |||
| 130 | |||
| 131 | Type vtSecurity_attributes |
||
| 132 | Field vtSecurity_attributes.nLength as dWord |
||
| 133 | Field vtSecurity_attributes.lpDescriptor as Pointer |
||
| 134 | Field vtSecurity_attributes.bInheritHandle as Integer |
||
| 135 | End_Type // vtSecurity_attributes
|
||
| 136 | |||
| 137 | //nLength:
|
||
| 138 | // Specifies the size, in bytes, of this structure. Set this value to the size of the
|
||
| 139 | // SECURITY_ATTRIBUTES structure.
|
||
| 140 | // Windows NT: Some functions that use the SECURITY_ATTRIBUTES structure do not verify the
|
||
| 141 | // value of the nLength member. However, an application should still set it properly.
|
||
| 142 | // That ensures current, future, and cross-platform compatibility.
|
||
| 143 | //
|
||
| 144 | //lpSecurityDescriptor:
|
||
| 145 | // Points to a security descriptor for the object that controls the sharing of it.
|
||
| 146 | // If NULL is specified for this member, the object may be assigned the default security
|
||
| 147 | // descriptor of the calling process.
|
||
| 148 | //
|
||
| 149 | //bInheritHandle:
|
||
| 150 | // Specifies whether the returned handle is inherited when a new process is created.
|
||
| 151 | // If this member is TRUE, the new process inherits the handle.
|
||
| 152 | |||
| 153 | |||
| 154 | // BOOL CreateDirectory(
|
||
| 155 | // LPCTSTR lpPathName,
|
||
| 156 | // LPSECURITY_ATTRIBUTES lpSecurityAttributes // pointer to a security descriptor
|
||
| 157 | // );
|
||
| 158 | //
|
||
| 159 | // lpPathName
|
||
| 160 | // Points to a null-terminated string that specifies the path of the directory
|
||
| 161 | // to be created.
|
||
| 162 | // There is a default string size limit for paths of MAX_PATH characters.
|
||
| 163 | // This limit is related to how the CreateDirectory function parses paths.
|
||
| 164 | // lpSecurityAttributes
|
||
| 165 | // Pointer to a SECURITY_ATTRIBUTES structure als called a security descriptor that
|
||
| 166 | // determines whether the returned handle can be inherited by child processes.
|
||
| 167 | // If lpSecurityAttributes is NULL, the handle cannot be inherited.
|
||
| 168 | // Returns:
|
||
| 169 | // If the function succeeds, the return value is nonzero.
|
||
| 170 | // If the function fails, the return value is zero. To get extended error information, call GetLastError.
|
||
| 171 | External_function vWin32_CreateDirectory "CreateDirectoryA" kernel32.dll ;
|
||
| 172 | Pointer lpPathName Pointer lpSecurity_Attributes Returns Integer |
||
| 173 | |||
| 174 | |||
| 175 | // lpPathName
|
||
| 176 | // Points to a null-terminated string that specifies the path of the directory
|
||
| 177 | // to be removed.
|
||
| 178 | // There is a default string size limit for paths of MAX_PATH characters.
|
||
| 179 | // Returns:
|
||
| 180 | // If the function succeeds, the return value is nonzero.
|
||
| 181 | // If the function fails, the return value is zero. To get extended error information, call GetLastError.
|
||
| 182 | External_function vWin32_RemoveDirectory "RemoveDirectoryA" kernel32.dll ;
|
||
| 183 | Pointer lpPathName Returns Integer |
||
| 184 | |||
| 185 | |||
| 186 | |||
| 187 | // The ShellExecute function opens or prints a specified file. The file can be an
|
||
| 188 | // executable file or a document file.
|
||
| 189 | //
|
||
| 190 | // Operation can be one of the following:
|
||
| 191 | // "OPEN" The function opens the file specified by lpFile.
|
||
| 192 | // The file can be an executable file or a document file.
|
||
| 193 | // The file can be a folder to open.
|
||
| 194 | // "PRINT" The function prints the file specified by lpFile.
|
||
| 195 | // The file should be a document file. If the file is an executable file,
|
||
| 196 | // the function opens the file, as if ?open? had been specified.
|
||
| 197 | // "EXPLORE" The function explores the folder specified by lpFile.
|
||
| 198 | //
|
||
| 199 | // Return Values:
|
||
| 200 | //
|
||
| 201 | // If the function succeeds, the return value is the instance handle of the application that
|
||
| 202 | // was run, or the handle of a dynamic data exchange (DDE) server application.
|
||
| 203 | // If the function fails, the return value is an error value that is less than or equal to 32.
|
||
| 204 | //
|
||
| 205 | // The following table lists these error values:
|
||
| 206 | // Public Const ERROR_FILE_NOT_FOUND = 2&
|
||
| 207 | // Public Const ERROR_PATH_NOT_FOUND = 3&
|
||
| 208 | // Public Const ERROR_BAD_FORMAT = 11&
|
||
| 209 | // Public Const SE_ERR_ACCESSDENIED = 5
|
||
| 210 | // Public Const SE_ERR_ASSOCINCOMPLETE = 27
|
||
| 211 | // Public Const SE_ERR_DDEBUSY = 30
|
||
| 212 | // Public Const SE_ERR_DDEFAIL = 29
|
||
| 213 | // Public Const SE_ERR_DDETIMEOUT = 28
|
||
| 214 | // Public Const SE_ERR_DLLNOTFOUND = 32
|
||
| 215 | // Public Const SE_ERR_FNF = 2
|
||
| 216 | // Public Const SE_ERR_NOASSOC = 31
|
||
| 217 | // Public Const SE_ERR_OOM = 8
|
||
| 218 | // Public Const SE_ERR_PNF = 3
|
||
| 219 | // Public Const SE_ERR_SHARE = 26
|
||
| 220 | |||
| 221 | |||
| 222 | |||
| 223 | // Code to open the program that is associated with the selected file.
|
||
| 224 | //
|
||
| 225 | // External function call used in Procedure DoStartDocument
|
||
| 226 | External_function vWin32_ShellExecute "ShellExecuteA" shell32.dll ;
|
||
| 227 | Handle hWnd ; |
||
| 228 | Pointer lpOperation ; |
||
| 229 | Pointer lpFile ; |
||
| 230 | Pointer lpParameters ; |
||
| 231 | Pointer lpDirectory ; |
||
| 232 | Dword iShowCmd Returns Handle |
||
| 233 | |||
| 234 | |||
| 235 | |||
| 236 | #IFDEF vFO_MOVE
|
||
| 237 | #ELSE
|
||
| 238 | |||
| 239 | #Replace vFO_MOVE |CI$0001 |
||
| 240 | #Replace vFO_COPY |CI$0002 |
||
| 241 | #Replace vFO_DELETE |CI$0003 |
||
| 242 | #Replace vFO_RENAME |CI$0004 |
||
| 243 | |||
| 244 | #Replace vFOF_MULTIDESTFILES |CI$0001 |
||
| 245 | #Replace vFOF_CONFIRMMOUSE |CI$0002 |
||
| 246 | #Replace vFOF_SILENT |CI$0004 // don't create progress/report |
||
| 247 | #Replace vFOF_RENAMEONCOLLISION |CI$0008 |
||
| 248 | #Replace vFOF_NOCONFIRMATION |CI$0010 // Don't prompt the user. |
||
| 249 | #Replace vFOF_WANTMAPPINGHANDLE |CI$0020 // Fill in SHFILEOPSTRUCT.hNameMappings |
||
| 250 | // Must be freed using SHFreeNameMappings
|
||
| 251 | #Replace vFOF_ALLOWUNDO |CI$0040 |
||
| 252 | #Replace vFOF_FILESONLY |CI$0080 // on *.*, do only files |
||
| 253 | #Replace vFOF_SIMPLEPROGRESS |CI$0100 // means don't show names of files |
||
| 254 | #Replace vFOF_NOCONFIRMMKDIR |CI$0200 // don't confirm making any needed dirs |
||
| 255 | |||
| 256 | Type vtShFileOpStruct |
||
| 257 | Field vtShFileOpStruct.hWnd as Handle |
||
| 258 | Field vtShFileOpStruct.wFunc as Integer |
||
| 259 | Field vtShFileOpStruct.pFrom as Pointer |
||
| 260 | Field vtShFileOpStruct.pTo as Pointer |
||
| 261 | Field vtShFileOpStruct.fFlags as Short |
||
| 262 | Field vtShFileOpStruct.fAnyOperationsAborted as Short |
||
| 263 | Field vtShFileOpStruct.hNameMappings as Pointer |
||
| 264 | Field vtShFileOpStruct.lpszProgressTitle as Pointer // only used if FOF_SIMPLEPROGRESS
|
||
| 265 | End_Type // tShFileOpStruct
|
||
| 266 | |||
| 267 | // hwnd
|
||
| 268 | // Handle of the dialog box to use to display information about the status of the operation.
|
||
| 269 | |||
| 270 | // wFunc
|
||
| 271 | // Operation to perform. This member can be one of the following values:
|
||
| 272 | // FO_COPY Copies the files specified by pFrom to the location specified by pTo.
|
||
| 273 | // FO_DELETE Deletes the files specified by pFrom (pTo is ignored).
|
||
| 274 | // FO_MOVE Moves the files specified by pFrom to the location specified by pTo.
|
||
| 275 | // FO_RENAME Renames the files specified by pFrom.
|
||
| 276 | |||
| 277 | // pFrom
|
||
| 278 | // Pointer to a buffer that specifies one or more source file names. Multiple names must
|
||
| 279 | // be null-separated. The list of names must be double null-terminated.
|
||
| 280 | |||
| 281 | // pTo
|
||
| 282 | // Pointer to a buffer that contains the name of the destination file or directory. The
|
||
| 283 | // buffer can contain mutiple destination file names if the fFlags member specifies
|
||
| 284 | // FOF_MULTIDESTFILES. Multiple names must be null-separated. The list of names must be
|
||
| 285 | // double null-terminated.
|
||
| 286 | |||
| 287 | // fAnyOperationsAborted
|
||
| 288 | // Value that receives TRUE if the user aborted any file operations before they
|
||
| 289 | // were completed or FALSE otherwise.
|
||
| 290 | |||
| 291 | #ENDIF
|
||
| 292 | |||
| 293 | // Performs a copy, move, rename, or delete operation on a file system object.
|
||
| 294 | // This can be a file or a folder.
|
||
| 295 | // With thanks to Andrew S Kaplan
|
||
| 296 | External_function vWin32_SHFileOperation "SHFileOperationA" Shell32.dll ;
|
||
| 297 | Pointer lpFileOp Returns Integer |
||
| 298 | |||
| 299 | |||
| 300 | // Thanks To Oliver Nelson for posting this code on the newsgroups
|
||
| 301 | External_function vWin32_GetWindowsDirectory "GetWindowsDirectoryA" kernel32.dll ;
|
||
| 302 | Pointer lpBuffer Integer nSize Returns Integer |
||
| 303 | |||
| 304 | |||
| 305 | |||
| 306 | // Courtesy Of Vincent Oorsprong
|
||
| 307 | //External_Function vWin32_GetTempFileName "GetTempFileNameA" Kernel32.Dll ;
|
||
| 308 | // Pointer lpPathName ;
|
||
| 309 | // Pointer lpPrefixString ;
|
||
| 310 | // Integer uUnique ;
|
||
| 311 | // Pointer lpTempFileName ;
|
||
| 312 | // Returns Integer
|
||
| 313 | // **WvA: 28-04-2005 Changed string parameter type into pointers
|
||
| 314 | External_function vWin32_GetTempFileName "GetTempFileNameA" kernel32.dll Pointer lpsPath ;
|
||
| 315 | Pointer lpsPrefix Integer iUnique Pointer pLoad Returns Integer |
||
| 316 | |||
| 317 | External_function vWin32_GetTempPath "GetTempPathA" Kernel32.Dll ;
|
||
| 318 | Dword nBufferLength ; |
||
| 319 | Pointer lpBuffer ; |
||
| 320 | Returns Integer |
||
| 321 | |||
| 322 | External_function vWin32_DeleteFile "DeleteFileA" Kernel32.Dll ;
|
||
| 323 | Pointer lpFileName ; |
||
| 324 | Returns Integer |
||
| 325 | |||
| 326 | // from:
|
||
| 327 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp
|
||
| 328 | //
|
||
| 329 | Define vCSIDL_FLAG_CREATE For |CI$8000 // IE5+, use this to create a special folder |
||
| 330 | Define vCSIDL_ADMIN_TOOLS For |CI$0030 // IE5+, The file system directory that is used to store administrative tools for an individual user |
||
| 331 | Define vCSIDL_ALT_STARTUP For |CI$001D // The file system directory that corresponds to the user's nonlocalized Startup program group |
||
| 332 | Define vCSIDL_APPDATA For |CI$001A // Version 4.71. The file system directory that serves as a common repository for application-specific data. A typical path is C:\Documents and Settings\<username>\Application Data |
||
| 333 | Define vCSIDL_BITBUCKET For |CI$000A // The virtual folder containing the objects in the user's Recycle Bin |
||
| 334 | Define vCSIDL_CDBURN_AREA For |CI$003B // IE6+ 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 |
||
| 335 | Define vCSIDL_COMMON_ADMINTOOLS For |CI$002F // IE5+ The file system directory containing administrative tools for all users of the computer |
||
| 336 | Define vCSIDL_COMMON_ALTSTARTUP For |CI$001E // The file system directory that corresponds to the nonlocalized Startup program group for all users |
||
| 337 | Define vCSIDL_COMMON_APPDATA For |CI$0023 // IE5+ The file system directory containing application data for all users. A typical path is C:\Documents and Settings\All Users\Application Data |
||
| 338 | Define vCSIDL_COMMON_DESKTOPDIRECTORY for |CI$0019 // WinNT+ Only, The file system directory that contains files and folders that appear on the desktop for all users. A typical path is C:\Documents and Settings\All Users\Desktop |
||
| 339 | Define vCSIDL_COMMON_DOCUMENTS For |CI$002E // IE5+ The file system directory that contains documents that are common to all users. A typical paths is C:\Documents and Settings\All Users\Documents |
||
| 340 | Define vCSIDL_COMMON_FAVORITES For |CI$001F // The file system directory that serves as a common repository for favorite items common to all users |
||
| 341 | Define vCSIDL_COMMON_MUSIC For |CI$0035 // IE6+ The file system directory that serves as a repository for music files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Music |
||
| 342 | Define vCSIDL_COMMON_PICTURES For |CI$0036 // The file system directory that serves as a repository for image files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Pictures |
||
| 343 | Define vCSIDL_COMMON_PROGRAMS For |CI$0017 // WinNT+ The file system directory that contains the directories for the common program groups that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs |
||
| 344 | Define vCSIDL_COMMON_STARTMENU For |CI$0016 // WinNT+ The file system directory that contains the programs and folders that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu |
||
| 345 | Define vCSIDL_COMMON_STARTUP For |CI$0018 // WinNT+ The file system directory that contains the programs that appear in the Startup folder for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs\Startup |
||
| 346 | Define vCSIDL_COMMON_TEMPLATES For |CI$002D // WinNT+ The file system directory that contains the templates that are available to all users. A typical path is C:\Documents and Settings\All Users\Templates |
||
| 347 | Define vCSIDL_COMMON_VIDEO For |CI$0037 // IE6+ The file system directory that serves as a repository for video files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Videos |
||
| 348 | Define vCSIDL_COMPUTERSNEARME For |CI$003D // The folder representing other machines in your workgroup |
||
| 349 | Define vCSIDL_CONNECTIONS For |CI$0031 // The virtual folder representing Network Connections, containing network and dial-up connections |
||
| 350 | Define vCSIDL_CONTROLS For |CI$0003 // The virtual folder containing icons for the Control Panel applications |
||
| 351 | Define vCSIDL_COOKIES For |CI$0021 // The file system directory that serves as a common repository for Internet cookies. A typical path is C:\Documents and Settings\username\Cookies |
||
| 352 | Define vCSIDL_DESKTOP For |CI$0000 // The virtual folder representing the Windows desktop, the root of the namespace |
||
| 353 | Define vCSIDL_DESKTOPDIRECTORY For |CI$0010 // The file system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself). A typical path is C:\Documents and Settings\username\Desktop |
||
| 354 | Define vCSIDL_DRIVES For |CI$0011 // The virtual folder representing My Computer, containing everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives |
||
| 355 | Define vCSIDL_FAVORITES For |CI$0006 // The file system directory that serves as a common repository for the user's favorite items. A typical path is C:\Documents and Settings\username\Favorites |
||
| 356 | Define vCSIDL_FONTS For |CI$0014 // A virtual folder containing fonts. A typical path is C:\Windows\Fonts |
||
| 357 | Define vCSIDL_HISTORY For |CI$0022 // The file system directory that serves as a common repository for Internet history items |
||
| 358 | Define vCSIDL_INTERNET For |CI$0001 // A virtual folder representing the Internet |
||
| 359 | Define vCSIDL_INTERNET_CACHE For |CI$0020 // Comctl4.72+, The file system directory that serves as a common repository for temporary Internet files. A typical path is C:\Documents and Settings\username\Local Settings\Temporary Internet Files |
||
| 360 | Define vCSIDL_LOCAL_APPDATA For |CI$001C // IE5+ The file system directory that serves as a data repository for local (nonroaming) applications. A typical path is C:\Documents and Settings\username\Local Settings\Application Data |
||
| 361 | Define vCSIDL_MYDOCUMENTS For |CI$000C // IE6+ The virtual folder representing the My Documents desktop item |
||
| 362 | Define vCSIDL_MYMUSIC For |CI$000D // The file system directory that serves as a common repository for music files. A typical path is C:\Documents and Settings\User\My Documents\My Music |
||
| 363 | Define vCSIDL_MYPICTURES For |CI$0027 // IE5+ The file system directory that serves as a common repository for image files. A typical path is C:\Documents and Settings\username\My Documents\My Pictures |
||
| 364 | Define vCSIDL_MYVIDEO For |CI$000E // IE6+ The file system directory that serves as a common repository for video files. A typical path is C:\Documents and Settings\username\My Documents\My Videos |
||
| 365 | Define vCSIDL_NETHOOD For |CI$0013 // A file system directory containing the link objects that may exist in the My Network Places virtual folder. It is not the same as CSIDL_NETWORK, which represents the network namespace root. A typical path is C:\Documents and Settings\username\NetHood |
||
| 366 | Define vCSIDL_NETWORK For |CI$0012 // A virtual folder representing Network Neighborhood, the root of the network namespace hierarchy |
||
| 367 | Define vCSIDL_PERSONAL For |CI$0005 // (Documents folder) IE6 The virtual folder representing the My Documents desktop item. |
||
| 368 | // This is equivalent to CSIDL_MYDOCUMENTS. Previous to Version 6.0. The file system directory used to physically store a user's common repository of documents. A typical path is C:\Documents and Settings\username\My Documents
|
||
| 369 | Define vCSIDL_PHOTOALBUMS For |CI$0045 // Vista+ The virtual folder used to store photo albums, typically username\My Pictures\Photo Albums |
||
| 370 | Define vCSIDL_PLAYLISTS For |CI$003F // Vista+ The virtual folder used to store play albums, typically username\My Music\Playlists |
||
| 371 | Define vCSIDL_PRINTERS For |CI$0004 // The virtual folder containing installed printers |
||
| 372 | Define vCSIDL_PRINTHOOD For |CI$001B // The file system directory that contains the link objects that can exist in the Printers virtual folder. A typical path is C:\Documents and Settings\username\PrintHood |
||
| 373 | Define vCSIDL_PROFILE For |CI$0028 // IE5+ The user's profile folder. A typical path is C:\Documents and Settings\username |
||
| 374 | Define vCSIDL_PROGRAM_FILES For |CI$0026 // IE5+ The Program Files folder. A typical path is C:\Program Files |
||
| 375 | Define vCSIDL_PROGRAM_FILES_COMMON For |CI$002B // IE5+, WinNT+ A folder for components that are shared across applications. A typical path is C:\Program Files\Common |
||
| 376 | Define vCSIDL_PROGRAMS For |CI$0002 // The file system directory that contains the user's program groups (which are themselves file system directories). A typical path is C:\Documents and Settings\username\Start Menu\Programs |
||
| 377 | Define vCSIDL_RECENT For |CI$0008 // The file system directory that contains shortcuts to the user's most recently used documents. A typical path is C:\Documents and Settings\username\My Recent Documents |
||
| 378 | Define vCSIDL_RESOURCES For |CI$0038 // undocumented |
||
| 379 | Define vCSIDL_SAMPLE_MUSIC For |CI$0040 // Vista+, The file system directory that contains sample music. A typical path is C:\Documents and Settings\username\My Documents\My Music\Sample Music |
||
| 380 | Define vCSIDL_SAMPLE_PLAYLISTS For |CI$0041 // Vista+, The file system directory that contains sample playlists. A typical path is C:\Documents and Settings\username\My Documents\My Music\Sample Playlists |
||
| 381 | Define vCSIDL_SAMPLE_PICTURES For |CI$0042 // Vista+, The file system directory that contains sample pictures. A typical path is C:\Documents and Settings\username\My Documents\My Pictures\Sample Pictures |
||
| 382 | Define vCSIDL_SAMPLE_VIDEOS For |CI$0043 // Vista+, The file system directory that contains sample videos. A typical path is C:\Documents and Settings\username\My Documents\My Videos\Sample Videos |
||
| 383 | Define vCSIDL_SENDTO For |CI$0009 // The file system directory that contains Send To menu items. A typical path is C:\Documents and Settings\username\SendTo |
||
| 384 | Define vCSIDL_STARTMENU For |CI$000B // The file system directory containing Start menu items. A typical path is C:\Documents and Settings\username\Start Menu |
||
| 385 | Define vCSIDL_STARTUP For |CI$0007 // The file system directory that corresponds to the user's Startup program group. The system starts these programs whenever any user logs onto Windows NT or starts Windows 95. A typical path is C:\Documents and Settings\username\Start Menu\Programs\Startup |
||
| 386 | Define vCSIDL_SYSTEM For |CI$0025 // The Windows System folder. A typical path is C:\Windows\System32 |
||
| 387 | 9 | wil | Define vCSIDL_SYSTEMX86 For |CI$0029 // |
| 388 | 2 | wil | Define vCSIDL_TEMPLATES For |CI$0015 // The file system directory that serves as a common repository for document templates. A typical path is C:\Documents and Settings\username\Templates |
| 389 | Define vCSIDL_WINDOWS For |CI$0024 // The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. A typical path is C:\Windows |
||
| 390 | |||
| 391 | |||
| 392 | //HRESULT SHGetFolderPath(
|
||
| 393 | // HWND hwndOwner,
|
||
| 394 | // int nFolder,
|
||
| 395 | // HANDLE hToken,
|
||
| 396 | // DWORD dwFlags,
|
||
| 397 | // LPTSTR pszPath
|
||
| 398 | //);
|
||
| 399 | // This function is a superset of SHGetSpecialFolderPath, included with earlier versions of
|
||
| 400 | // the shell. It is implemented in a redistributable DLL, SHFolder.dll, that also simulates
|
||
| 401 | // many of the new shell folders on older platforms such as Windows 95, Windows 98, and
|
||
| 402 | // Windows NT 4.0. This DLL always calls the current platform's version of this function.
|
||
| 403 | // If that fails, it will try to simulate the appropriate behavior.
|
||
| 404 | //
|
||
| 405 | External_function vWin32_SHGetFolderPath "SHGetFolderPathA" SHFolder.Dll ;
|
||
| 406 | Pointer hWnd ; |
||
| 407 | Integer nFolder ; |
||
| 408 | Pointer hToken ; |
||
| 409 | DWord dwFlags ; |
||
| 410 | Pointer lpszPath ; |
||
| 411 | Returns Integer |
||
| 412 | |||
| 413 | |||
| 414 | |||
| 415 | Type vWin32_Find_Data |
||
| 416 | Field vWin32_Find_Data.dwFileAttributes As Dword |
||
| 417 | Field vWin32_Find_Data.ftCreationLowDateTime As Dword |
||
| 418 | Field vWin32_Find_Data.ftCreationHighDateTime As Dword |
||
| 419 | Field vWin32_Find_Data.ftLastAccessLowDateTime As dword |
||
| 420 | Field vWin32_Find_Data.ftLastAccessHighDateTime As Dword |
||
| 421 | Field vWin32_Find_Data.ftLastWriteLowDateTime As Dword |
||
| 422 | Field vWin32_Find_Data.ftLastWriteHighDateTime As Dword |
||
| 423 | Field vWin32_Find_Data.nFileSizeHigh As Dword |
||
| 424 | Field vWin32_Find_Data.nFileSizeLow As Dword |
||
| 425 | Field vWin32_Find_Data.dwReserved0 As Dword |
||
| 426 | Field vWin32_Find_Data.dwReserved1 As Dword |
||
| 427 | Field vWin32_Find_Data.cFileName As Char vMax_Path |
||
| 428 | Field vWin32_Find_Data.cAlternateFileName As Char 14
|
||
| 429 | End_Type // vWin32_Find_Data
|
||
| 430 | |||
| 431 | // Courtesy Of Vincent Oorsprong
|
||
| 432 | // lpFileName : address of name of file to search for
|
||
| 433 | // lpFindFileData : address of returned information
|
||
| 434 | External_function vWin32_FindFirstFile "FindFirstFileA" Kernel32.dll Pointer lpFileName ;
|
||
| 435 | Pointer lpFindFileData Returns Handle |
||
| 436 | |||
| 437 | // Courtesy Of Vincent Oorsprong
|
||
| 438 | // hFindFile : handle of search
|
||
| 439 | // lpFindFileData : address of structure for data on found file
|
||
| 440 | External_function vWin32_FindNextFile "FindNextFileA" Kernel32.dll Handle hFindFile ;
|
||
| 441 | Pointer lpFindFileData Returns Integer |
||
| 442 | |||
| 443 | // Courtesy Of Vincent Oorsprong
|
||
| 444 | // hFindFile : file search handle
|
||
| 445 | External_function vWin32_FindClose "FindClose" Kernel32.dll Handle hFindFile Returns Integer
|
||
| 446 | |||
| 447 | |||
| 448 | |||
| 449 | Type vFileTime |
||
| 450 | Field vFileTime.dwLowDateTime As Dword |
||
| 451 | Field vFileTime.dwHighDateTime As Dword |
||
| 452 | End_Type // vFileTime
|
||
| 453 | |||
| 454 | |||
| 455 | Type vSystemTime |
||
| 456 | Field vSystemTime.wYear As Word |
||
| 457 | Field vSystemTime.wMonth As Word |
||
| 458 | Field vSystemTime.wDayOfWeek As Word |
||
| 459 | Field vSystemTime.wDay As Word |
||
| 460 | Field vSystemTime.wHour As Word |
||
| 461 | Field vSystemTime.wMinute As Word |
||
| 462 | Field vSystemTime.wSecond As Word |
||
| 463 | Field vSystemTime.wMilliSeconds As Word |
||
| 464 | End_Type // vSystemTime
|
||
| 465 | |||
| 466 | |||
| 467 | // Courtesy Of Vincent Oorsprong
|
||
| 468 | // lpFileTime : pointer to file time to convert
|
||
| 469 | // lpSystemTime : pointer to structure to receive system time
|
||
| 470 | External_function vWin32_FileTimeToSystemTime "FileTimeToSystemTime" Kernel32.Dll ;
|
||
| 471 | Pointer lpFileTime Pointer lpsystemTime Returns Integer |
||
| 472 | |||
| 473 | // Courtesy Of Vincent Oorsprong
|
||
| 474 | // This function formats the time in a picture-string passed
|
||
| 475 | //
|
||
| 476 | // Picture Meaning
|
||
| 477 | // h Hours with no leading zero for single-digit hours; 12-hour clock
|
||
| 478 | // hh Hours with leading zero for single-digit hours; 12-hour clock
|
||
| 479 | // H Hours with no leading zero for single-digit hours; 24-hour clock
|
||
| 480 | // HH Hours with leading zero for single-digit hours; 24-hour clock
|
||
| 481 | // m Minutes with no leading zero for single-digit minutes
|
||
| 482 | // mm Minutes with leading zero for single-digit minutes
|
||
| 483 | // s Seconds with no leading zero for single-digit seconds
|
||
| 484 | // ss Seconds with leading zero for single-digit seconds
|
||
| 485 | // t One character time marker string, such as A or P
|
||
| 486 | // tt Multicharacter time marker string, such as AM or PM
|
||
| 487 | //
|
||
| 488 | // For example, to get the time string "11:29:40 PM"
|
||
| 489 | // use the following picture string: "hh" : "mm" : "ss tt"
|
||
| 490 | |||
| 491 | External_function vWin32_GetTimeFormat "GetTimeFormatA" Kernel32.Dll ;
|
||
| 492 | Dword LCID Dword dwFlags Pointer lpsSystemTime Pointer lpFormat Pointer lpTimeStr ; |
||
| 493 | Integer cchTime Returns Integer |
||
| 494 | |||
| 495 | |||
| 496 | // Courtesy Of Vincent Oorsprong
|
||
| 497 | // This function formats the date in a picture-string passed
|
||
| 498 | //
|
||
| 499 | // Picture Meaning
|
||
| 500 | // d Day of month as digits with no leading zero for single-digit days.
|
||
| 501 | // dd Day of month as digits with leading zero for single-digit days.
|
||
| 502 | // ddd Day of week as a three-letter abbreviation. The function uses the
|
||
| 503 | // LOCALE_SABBREVOAYMAME value associated with the specified locale.
|
||
| 504 | // dddd Day of week as its full name. The function uses the LOCALE_SDAYNAME
|
||
| 505 | // value associated with the specified locale.
|
||
| 506 | // M Month as digits with no leading zero for single-digit months.
|
||
| 507 | // MM Month as digits with leading zero for single-digit months.
|
||
| 508 | // MMM Month as a three-letter abbreviation. The function uses the
|
||
| 509 | // LOCALE_SABBREVMONTHNAME value associated with the specified locale.
|
||
| 510 | // MMMM Month as its full name. The function uses the LOCALE_SMONTHNAME value
|
||
| 511 | // associated with the specified locale.
|
||
| 512 | // y Year as last two digits, but with no leading zero for years less than 10.
|
||
| 513 | // yy Year as last two digits, but with leading zero for years less than 10.
|
||
| 514 | // yyyy Year represented hy full four digits.
|
||
| 515 | // gg Period/era string. The function uses the CAL_SERASTRING value associated
|
||
| 516 | // with the specified locale. This element is ignored if the date to be formatted
|
||
| 517 | // does not have an associated era or period string.
|
||
| 518 | // For example, to get the date string "Wed, Aug 31 94"
|
||
| 519 | // use the following picture string: "ddd","MMM dd yy"
|
||
| 520 | |||
| 521 | External_function vWin32_GetDateFormat "GetDateFormatA" Kernel32.Dll ;
|
||
| 522 | Dword LCID Dword dwFlags Pointer lpsSystemTime Pointer lpFormat Pointer lpDateStr ; |
||
| 523 | Integer cchDate Returns Integer |
||
| 524 | |||
| 525 | Define LOCALE_NOUSEROVERRIDE For |CI$80000000 // do not use user overrides |
||
| 526 | Define TIME_NOMIHUTESORSECONDS For |CI$0000000l // do not use minutes or seconds |
||
| 527 | Define TIME_NOSECONDS For |CI$00000002 // do not use seconds |
||
| 528 | Define TIME_NOTIMEMARKER For |CI$00000004 // do not use time marker |
||
| 529 | Define TIME_FORCE24HOURFORMAT For |CI$00000008 // always use 24 hour format |
||
| 530 | |||
| 531 | // Date Flags for GetDateFormatW.
|
||
| 532 | //
|
||
| 533 | Define DATE_SHORTDATE For |CI$0000000l // use short date picture |
||
| 534 | Define DATE_LONGDATE For |CI$00000002 // use long date picture |
||
| 535 | Define DATE_USE_ALT_CALENDAR For |CI$00000004 // use alternate calendar (if any) |
||
| 536 | |||
| 537 | |||
| 538 | External_function vWin32_SetLastError "SetLastError" Kernel32.Dll Dword dwLastError Returns Integer
|
||
| 539 | |||
| 540 | |||
| 541 | // **WvA: 20-02-2004
|
||
| 542 | // While i was testing the format capabilities i stumbled over a very
|
||
| 543 | // weird problem where it looks like that the integer value gets somehow translated
|
||
| 544 | // incorrectly into an unsigned integer.
|
||
| 545 | // I don't have the time to dive into this.. so added a workaround (and removed it again)
|
||
| 546 | // It does smell a bit fishy though
|
||
| 547 | // Tested it with the same results on both VDF7 and VDF9.1
|
||
| 548 | |||
| 549 | Define SHFMT_ID_DEFAULT For |CI$0000FFFF // The default format ID |
||
| 550 | Define SHFMT_OPT_DEFAULT For |CI$00000000 // The default "Quick Format" option. |
||
| 551 | Define SHFMT_OPT_FULL For |CI$00000001 // Deselects the "Quick Format" option, providing a full format instead. This is useful when an unformatted disk is detected. |
||
| 552 | Define SHFMT_OPT_SYSONLY For |CI$00000002 // Selects the "Create an MS-DOS startup disk" option, creating a system boot disk. |
||
| 553 | |||
| 554 | // Possible errors that can be returned by the shellformat function
|
||
| 555 | Define SHFMT_ERROR For (|CI$FFFFFFFF+1) // An error occurred during the last format or no drive parameter passed. This does not indicate that the disk is unformatable. |
||
| 556 | Define SHFMT_CANCEL For (|CI$FFFFFFFE+1) // The last format was canceled. |
||
| 557 | Define SHFMT_NOFORMAT For (|CI$FFFFFFFD+1) // The drive cannot be formatted. |
||
| 558 | |||
| 559 | |||
| 560 | // Courtesy Of Steve Walter,
|
||
| 561 | // USA Software, Inc
|
||
| 562 | // Format a disk
|
||
| 563 | // Called By: Move (vWin32_ShFormatDrive(hWnd,0,$FFFF,1)) To dwReturn
|
||
| 564 | External_function vWin32_ShFormatDrive "SHFormatDrive" shell32.dll Handle hWnd ;
|
||
| 565 | Integer iDrive Integer iFormatID Integer iOptions Returns DWORD |
||
| 566 | 9 | wil | |
| 567 | // Michael Mullan. I Wanted to create all the folders in one statement...
|
||
| 568 | |||
| 569 | // SHCreateDirectoryEx
|
||
| 570 | |||
| 571 | // Note This function is available through Microsoft Windows XP Service Pack 2 (SP2) and Windows Server 2003.
|
||
| 572 | // It might be altered or unavailable in subsequent versions of Windows.
|
||
| 573 | //
|
||
| 574 | // This function creates a file system folder whose fully qualified path is given by pszPath. If one or more
|
||
| 575 | // of the intermediate folders do not exist, they are created as well. SHCreateDirectoryEx also verifies that
|
||
| 576 | // the files are visible. If they are not visible, expect one of the following:
|
||
| 577 | //
|
||
| 578 | // * If hwnd is set to a valid window handle, a message box is displayed warning the user that he or she
|
||
| 579 | // might not be able to access the files. If the user chooses not to proceed, the function returns
|
||
| 580 | // ERROR_CANCELLED.
|
||
| 581 | // * If hwnd is set to NULL, no user interface is displayed and the function returns ERROR_CANCELLED.
|
||
| 582 | |||
| 583 | // Returns ERROR_SUCCESS if successful. If the operation fails, other error codes can be returned,
|
||
| 584 | // including those listed here. For values not specifically listed, see System Error Codes.
|
||
| 585 | // 161 ERROR_BAD_PATHNAME The pszPath parameter was set to a relative path.
|
||
| 586 | // 206 ERROR_FILENAME_EXCED_RANGE The path pointed to by pszPath is too long.
|
||
| 587 | // 3 ERROR_PATH_NOT_FOUND The system cannot find the path pointed to by pszPath. The path may contain an invalid entry.
|
||
| 588 | // 80 ERROR_FILE_EXISTS The directory exists.
|
||
| 589 | // 183 ERROR_ALREADY_EXISTS The directory exists.
|
||
| 590 | // 1223 ERROR_CANCELLED The user canceled the operation.
|
||
| 591 | |||
| 592 | // int SHCreateDirectoryEx(
|
||
| 593 | // HWND hwnd,
|
||
| 594 | // LPCTSTR pszPath,
|
||
| 595 | // const SECURITY_ATTRIBUTES *psa
|
||
| 596 | // );
|
||
| 597 | |||
| 598 | External_function vWin32_SHCreateDirectoryEx "SHCreateDirectoryExA" shell32.dll Handle hWnd;
|
||
| 599 | pointer pszPath Pointer lpSecurity_Attributes Returns Integer |
||
| 600 | |||
| 601 | #IFNDEF INVALID_HANDLE_VALUE
|
||
| 602 | Define INVALID_HANDLE_VALUE for -1 |
||
| 603 | #ENDIF |