shellapi.pp 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. This unit contains the record definition for the Win32 API
  5. Copyright (c) 1999-2002 by Marco van de Voort,
  6. member of the Free Pascal development team.
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. ************************************************************************}
  13. { leave out unused functions so the unit can be used on win2000 as well }
  14. {$ifndef NO_SMART_LINK}
  15. {$smartlink on}
  16. {$endif}
  17. {$PACKRECORDS C}
  18. {$calling stdcall}
  19. {$mode objfpc}
  20. Unit ShellApi;
  21. //+-------------------------------------------------------------------------
  22. //
  23. // Microsoft Windows
  24. // Copyright (c) Microsoft Corporation. All rights reserved.
  25. //
  26. // File: shellapi.h
  27. //
  28. // Header translation by Marco van de Voort for Free Pascal Platform
  29. // SDK dl'ed January 2002
  30. //
  31. //--------------------------------------------------------------------------
  32. Interface
  33. Uses Windows;
  34. {
  35. shellapi.h - SHELL.DLL functions, types, and definitions
  36. Copyright (c) Microsoft Corporation. All rights reserved. }
  37. Type HDROP = THandle;
  38. UINT_PTR = ^UINT;
  39. DWORD_PTR= ^DWORD;
  40. pHICON = ^HICON;
  41. pBool = ^BOOL;
  42. STARTUPINFOW = record // a guess. Omission should get fixed in Windows.
  43. cb : DWORD;
  44. lpReserved : LPTSTR;
  45. lpDesktop : LPTSTR;
  46. lpTitle : LPTSTR;
  47. dwX : DWORD;
  48. dwY : DWORD;
  49. dwXSize : DWORD;
  50. dwYSize : DWORD;
  51. dwXCountChars : DWORD;
  52. dwYCountChars : DWORD;
  53. dwFillAttribute : DWORD;
  54. dwFlags : DWORD;
  55. wShowWindow : WORD;
  56. cbReserved2 : WORD;
  57. lpReserved2 : LPBYTE;
  58. hStdInput : HANDLE;
  59. hStdOutput : HANDLE;
  60. hStdError : HANDLE;
  61. end;
  62. LPSTARTUPINFOW = ^STARTUPINFOW;
  63. _STARTUPINFOW = STARTUPINFOW;
  64. TSTARTUPINFOW = STARTUPINFOW;
  65. PSTARTUPINFOW = ^STARTUPINFOW;
  66. {unicode}
  67. Function DragQueryFileA(arg1 : HDROP; arg2 : UINT;arg3 : LPSTR ; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileA';
  68. Function DragQueryFileW(arg1 : HDROP; arg2 : UINT;arg3 : LPWSTR; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileW';
  69. Function DragQueryFile(arg1 : HDROP; arg2 : UINT;arg3 : LPSTR ; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileA';
  70. Function DragQueryFile(arg1 : HDROP; arg2 : UINT;arg3 : LPWSTR; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileW';
  71. Function DragQueryPoint(arg1 : HDROP; arg2 :LPPOINT):BOOL; external 'shell32.dll' name 'DragQueryPoint';
  72. Procedure DragFinish(arg1 : HDROP); external 'shell32.dll' name 'DragFinish';
  73. Procedure DragAcceptFiles(hwnd : HWND;arg2: BOOL); external 'shell32.dll' name 'DragAcceptFiles';
  74. Function ShellExecuteA(HWND: hwnd;lpOperation : LPCSTR ; lpFile : LPCSTR ; lpParameters : LPCSTR; lpDirectory: LPCSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteA';
  75. Function ShellExecuteW(hwnd: HWND;lpOperation : LPCWSTR ; lpFile : LPCWSTR ; lpParameters : LPCWSTR; lpDirectory: LPCWSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteW';
  76. Function ShellExecute(HWND: hwnd;lpOperation : LPCSTR ; lpFile : LPCSTR ; lpParameters : LPCSTR; lpDirectory: LPCSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteA';
  77. Function ShellExecute(hwnd: HWND;lpOperation : LPCWSTR ; lpFile : LPCWSTR ; lpParameters : LPCWSTR; lpDirectory: LPCWSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteW';
  78. Function FindExecutableA(lpFile : LPCSTR ;lpDirectory : LPCSTR ; lpResult : LPSTR):HInst;external 'shell32.dll' name 'FindExecutableA';
  79. Function FindExecutableW(lpFile : LPCWSTR;lpDirectory : LPCWSTR; lpResult : LPWSTR):HInst;external 'shell32.dll' name 'FindExecutableW';
  80. Function FindExecutable(lpFile : LPCSTR ;lpDirectory : LPCSTR ; lpResult : LPSTR):HInst;external 'shell32.dll' name 'FindExecutableA';
  81. Function FindExecutable(lpFile : LPCWSTR;lpDirectory : LPCWSTR; lpResult : LPWSTR):HInst;external 'shell32.dll' name 'FindExecutableW';
  82. Function CommandLineToArgvW(lpCmdLine : LPCWSTR;pNumArgs : plongint):pLPWSTR;external 'shell32.dll' name 'CommandLineToArgvW';
  83. Function ShellAboutA(HWND: hWnd; szApp : LPCSTR; szOtherStuff : LPCSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutA';
  84. Function ShellAboutW(HWND: hWnd; szApp : LPCWSTR; szOtherStuff : LPCWSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutW';
  85. Function ShellAbout(HWND: hWnd; szApp : LPCSTR; szOtherStuff : LPCSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutA';
  86. Function ShellAbout(HWND: hWnd; szApp : LPCWSTR; szOtherStuff : LPCWSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutW';
  87. Function DuplicateIcon(hinst : HINST; HICON: hIcon):HIcon; external 'shell32.dll' name 'DuplicateIcon';
  88. Function ExtractAssociatedIconA(hInst : HINST; lpIconPath : LPSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconA';
  89. Function ExtractAssociatedIconW(hInst : HINST; lpIconPath : LPWSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconW';
  90. Function ExtractAssociatedIcon(hInst : HINST; lpIconPath : LPSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconA';
  91. Function ExtractAssociatedIcon(hInst : HINST; lpIconPath : LPWSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconW';
  92. Function ExtractIconA(hInst: HINST; lpszExeFileName :LPCSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconA';
  93. Function ExtractIconW(hInst: HINST; lpszExeFileName :LPCWSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconW';
  94. Function ExtractIcon(hInst: HINST; lpszExeFileName :LPCSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconA';
  95. Function ExtractIcon(hInst: HINST; lpszExeFileName :LPCWSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconW';
  96. // if(WINVER >= 0x0400)
  97. Type
  98. { init with sizeof(DRAGINFO) }
  99. _DRAGINFOA = Record
  100. uSize : UINT;
  101. pt : POINT;
  102. fNC : BOOL;
  103. lpFileList : LPSTR;
  104. grfKeyState : DWORD;
  105. end;
  106. DRAGINFOA = _DRAGINFOA;
  107. TDRAGINFOA = _DRAGINFOA;
  108. LPDRAGINFOA = ^_DRAGINFOA;
  109. { init with sizeof(DRAGINFO) }
  110. _DRAGINFOW = Record
  111. uSize : UINT;
  112. pt : POINT;
  113. fNC : BOOL;
  114. lpFileList : LPWSTR;
  115. grfKeyState : DWORD;
  116. end;
  117. DRAGINFOW = _DRAGINFOW;
  118. TDRAGINFOW = _DRAGINFOW;
  119. LPDRAGINFOW = ^_DRAGINFOW;
  120. {$ifdef UNICODE}
  121. DRAGINFO = DRAGINFOW;
  122. TDRAGINFO = DRAGINFOW;
  123. LPDRAGINFO = LPDRAGINFOW;
  124. {$else}
  125. DRAGINFO = DRAGINFOA;
  126. TDRAGINFO = DRAGINFOW;
  127. LPDRAGINFO = LPDRAGINFOA;
  128. {$endif}
  129. Const
  130. ABM_NEW = $00000000;
  131. ABM_REMOVE = $00000001;
  132. ABM_QUERYPOS = $00000002;
  133. ABM_SETPOS = $00000003;
  134. ABM_GETSTATE = $00000004;
  135. ABM_GETTASKBARPOS = $00000005;
  136. ABM_ACTIVATE = $00000006; { lParam == TRUE/FALSE means activate/deactivate }
  137. ABM_GETAUTOHIDEBAR = $00000007;
  138. ABM_SETAUTOHIDEBAR = $00000008; { this can fail at any time. MUST check the result }
  139. { lParam = TRUE/FALSE Set/Unset }
  140. { uEdge = what edge }
  141. ABM_WINDOWPOSCHANGED = $0000009;
  142. ABM_SETSTATE = $0000000a;
  143. ABN_STATECHANGE = $0000000; { these are put in the wparam of callback messages }
  144. ABN_POSCHANGED = $0000001;
  145. ABN_FULLSCREENAPP = $0000002;
  146. ABN_WINDOWARRANGE = $0000003; { lParam == TRUE means hide }
  147. { flags for get state }
  148. ABS_AUTOHIDE = $0000001;
  149. ABS_ALWAYSONTOP = $0000002;
  150. ABE_LEFT = 0;
  151. ABE_TOP = 1;
  152. ABE_RIGHT = 2;
  153. ABE_BOTTOM = 3;
  154. Type
  155. _AppBarData = Record
  156. cbSize : DWORD;
  157. hWnd : HWND;
  158. uCallbackMessage : UINT;
  159. uEdge : UINT;
  160. rc : RECT;
  161. lParam : LPARAM; { message specific }
  162. end;
  163. APPBARDATA = _AppBarData;
  164. TAPPBARDATA = _AppBarData;
  165. PAPPBARDATA = ^_AppBarData;
  166. Function SHAppBarMessage(dwMessage : DWORD; pData : APPBARDATA):UINT_PTR;external 'shell32.dll' name 'SHAppBarMessage';
  167. //
  168. // EndAppBar
  169. //
  170. Function DoEnvironmentSubstA(szString: LPSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstA';
  171. Function DoEnvironmentSubstW(szString: LPWSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstW';
  172. Function DoEnvironmentSubst(szString: LPSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstA';
  173. Function DoEnvironmentSubst(szString: LPWSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstW';
  174. {Macro}
  175. function EIRESID(x : longint) : longint;
  176. Function ExtractIconExA(lpszFile : LPCSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExA';
  177. Function ExtractIconExW(lpszFile : LPCWSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExW';
  178. Function ExtractIconExA(lpszFile : LPCSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExA';
  179. Function ExtractIconExW(lpszFile : LPCWSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExW';
  180. Function ExtractIconEx (lpszFile : LPCSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExA';
  181. Function ExtractIconEx (lpszFile : LPCWSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExW';
  182. Function ExtractIconEx (lpszFile : LPCSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExA';
  183. Function ExtractIconEx (lpszFile : LPCWSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExW';
  184. //
  185. // Shell File Operations
  186. //
  187. //ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h}
  188. Const
  189. FO_MOVE = $0001;
  190. FO_COPY = $0002;
  191. FO_DELETE = $0003;
  192. FO_RENAME = $0004;
  193. FOF_MULTIDESTFILES = $0001;
  194. FOF_CONFIRMMOUSE = $0002;
  195. FOF_SILENT = $0004; { don't create progress/report }
  196. FOF_RENAMEONCOLLISION = $0008;
  197. FOF_NOCONFIRMATION = $0010; { Don't prompt the user. }
  198. FOF_WANTMAPPINGHANDLE = $0020; { Fill in SHFILEOPSTRUCT.hNameMappings }
  199. FOF_ALLOWUNDO = $0040; { Must be freed using SHFreeNameMappings }
  200. FOF_FILESONLY = $0080; { on *.*, do only files }
  201. FOF_SIMPLEPROGRESS = $0100; { means don't show names of files }
  202. FOF_NOCONFIRMMKDIR = $0200; { don't confirm making any needed dirs }
  203. FOF_NOERRORUI = $0400; { don't put up error UI }
  204. FOF_NOCOPYSECURITYATTRIBS= $0800; { dont copy NT file Security Attributes }
  205. FOF_NORECURSION = $1000; { don't recurse into directories. }
  206. //if (_WIN32_IE >= 0x0500)
  207. FOF_NO_CONNECTED_ELEMENTS= $2000; { don't operate on connected elements. }
  208. FOF_WANTNUKEWARNING = $4000; { during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION) }
  209. //endif
  210. //if (_WIN32_WINNT >= 0x0501)
  211. FOF_NORECURSEREPARSE = $8000; { treat reparse points as objects, not containers }
  212. //endif
  213. Type
  214. FILEOP_FLAGS = WORD;
  215. Const
  216. PO_DELETE = $0013; { printer is being deleted }
  217. PO_RENAME = $0014; { printer is being renamed }
  218. PO_PORTCHANGE = $0020; { port this printer connected to is being changed }
  219. { if this id is set, the strings received by }
  220. { the copyhook are a doubly-null terminated }
  221. { list of strings. The first is the printer }
  222. { name and the second is the printer port. }
  223. PO_REN_PORT = $0034; { PO_RENAME and PO_PORTCHANGE at same time. }
  224. { no POF_ flags currently defined }
  225. Type
  226. PRINTEROP_FLAGS = WORD;
  227. //endif}
  228. { FO_MOVE }
  229. { implicit parameters are: }
  230. { if pFrom or pTo are unqualified names the current directories are }
  231. { taken from the global current drive/directory settings managed }
  232. { by Get/SetCurrentDrive/Directory }
  233. { }
  234. { the global confirmation settings }
  235. { only used if FOF_SIMPLEPROGRESS }
  236. Type
  237. _SHFILEOPSTRUCTA = Record
  238. hwnd : HWND;
  239. wFunc : UINT;
  240. pFrom : LPCSTR;
  241. pTo : LPCSTR;
  242. fFlags : FILEOP_FLAGS;
  243. fAnyOperationsAborted : BOOL;
  244. hNameMappings : LPVOID;
  245. lpszProgressTitle : LPCSTR; { only used if FOF_SIMPLEPROGRESS }
  246. end;
  247. SHFILEOPSTRUCTA = _SHFILEOPSTRUCTA;
  248. TSHFILEOPSTRUCTA = _SHFILEOPSTRUCTA;
  249. LPSHFILEOPSTRUCTA = ^_SHFILEOPSTRUCTA;
  250. _SHFILEOPSTRUCTW = record
  251. hwnd : HWND;
  252. wFunc : UINT;
  253. pFrom : LPCWSTR;
  254. pTo : LPCWSTR;
  255. fFlags : FILEOP_FLAGS;
  256. fAnyOperationsAborted : BOOL;
  257. hNameMappings : LPVOID;
  258. lpszProgressTitle : LPCWSTR;
  259. end;
  260. SHFILEOPSTRUCTW = _SHFILEOPSTRUCTW;
  261. TSHFILEOPSTRUCTW = _SHFILEOPSTRUCTW;
  262. LPSHFILEOPSTRUCTW = ^_SHFILEOPSTRUCTW;
  263. {$ifdef UNICODE}
  264. SHFILEOPSTRUCT = SHFILEOPSTRUCTW;
  265. TSHFILEOPSTRUCT = SHFILEOPSTRUCTW;
  266. LPSHFILEOPSTRUCT = LPSHFILEOPSTRUCTW;
  267. {$else}
  268. SHFILEOPSTRUCT = SHFILEOPSTRUCTA;
  269. TSHFILEOPSTRUCT = SHFILEOPSTRUCTA;
  270. LPSHFILEOPSTRUCT = LPSHFILEOPSTRUCTA;
  271. {$endif}
  272. Function SHFileOperationA(lpFileOp:LPSHFILEOPSTRUCTA ):Longint;external 'shell32.dll' name 'SHFileOperationA';
  273. Function SHFileOperationW(lpFileOp:LPSHFILEOPSTRUCTW ):Longint;external 'shell32.dll' name 'SHFileOperationW';
  274. Function SHFileOperation(lpFileOp:LPSHFILEOPSTRUCTA ):Longint;external 'shell32.dll' name 'SHFileOperationA';
  275. Function SHFileOperation(lpFileOp:LPSHFILEOPSTRUCTW ):Longint;external 'shell32.dll' name 'SHFileOperationW';
  276. Procedure SHFreeNameMappings(hNameMappings : THandle);external 'shell32.dll' name 'SHFreeNameMappings';
  277. Type
  278. _SHNAMEMAPPINGA = Record
  279. pszOldPath : LPSTR;
  280. pszNewPath : LPSTR;
  281. cchOldPath : longint;
  282. cchNewPath : longint;
  283. end;
  284. SHNAMEMAPPINGA = _SHNAMEMAPPINGA;
  285. TSHNAMEMAPPINGA = _SHNAMEMAPPINGA;
  286. LPSHNAMEMAPPINGA = ^_SHNAMEMAPPINGA;
  287. _SHNAMEMAPPINGW = Record
  288. pszOldPath : LPWSTR;
  289. pszNewPath : LPWSTR;
  290. cchOldPath : longint;
  291. cchNewPath : longint;
  292. end;
  293. SHNAMEMAPPINGW = _SHNAMEMAPPINGW;
  294. TSHNAMEMAPPINGW = _SHNAMEMAPPINGW;
  295. LPSHNAMEMAPPINGW = ^_SHNAMEMAPPINGW;
  296. {$ifndef UNICODE}
  297. SHNAMEMAPPING = SHNAMEMAPPINGW;
  298. TSHNAMEMAPPING = SHNAMEMAPPINGW;
  299. LPSHNAMEMAPPING = LPSHNAMEMAPPINGW;
  300. {$else}
  301. SHNAMEMAPPING = SHNAMEMAPPINGA;
  302. TSHNAMEMAPPING = SHNAMEMAPPINGA;
  303. LPSHNAMEMAPPING = LPSHNAMEMAPPINGA;
  304. {$endif}
  305. //
  306. // End Shell File Operations
  307. //
  308. //
  309. // Begin ShellExecuteEx and family
  310. //
  311. { ShellExecute() and ShellExecuteEx() error codes }
  312. { regular WinExec() codes }
  313. const
  314. SE_ERR_FNF = 2; { file not found }
  315. SE_ERR_PNF = 3; { path not found }
  316. SE_ERR_ACCESSDENIED = 5; { access denied }
  317. SE_ERR_OOM = 8; { out of memory }
  318. SE_ERR_DLLNOTFOUND = 32;
  319. // endif WINVER >= 0x0400
  320. { error values for ShellExecute() beyond the regular WinExec() codes }
  321. SE_ERR_SHARE = 26;
  322. SE_ERR_ASSOCINCOMPLETE = 27;
  323. SE_ERR_DDETIMEOUT = 28;
  324. SE_ERR_DDEFAIL = 29;
  325. SE_ERR_DDEBUSY = 30;
  326. SE_ERR_NOASSOC = 31;
  327. //if(WINVER >= 0x0400)}
  328. { Note CLASSKEY overrides CLASSNAME }
  329. SEE_MASK_CLASSNAME = $00000001;
  330. SEE_MASK_CLASSKEY = $00000003;
  331. { Note INVOKEIDLIST overrides IDLIST }
  332. SEE_MASK_IDLIST = $00000004;
  333. SEE_MASK_INVOKEIDLIST = $0000000c;
  334. SEE_MASK_ICON = $00000010;
  335. SEE_MASK_HOTKEY = $00000020;
  336. SEE_MASK_NOCLOSEPROCESS = $00000040;
  337. SEE_MASK_CONNECTNETDRV = $00000080;
  338. SEE_MASK_FLAG_DDEWAIT = $00000100;
  339. SEE_MASK_DOENVSUBST = $00000200;
  340. SEE_MASK_FLAG_NO_UI = $00000400;
  341. SEE_MASK_UNICODE = $00004000;
  342. SEE_MASK_NO_CONSOLE = $00008000;
  343. SEE_MASK_ASYNCOK = $00100000;
  344. SEE_MASK_HMONITOR = $00200000;
  345. //if (_WIN32_IE >= 0x0500)
  346. SEE_MASK_NOQUERYCLASSSTORE= $01000000;
  347. SEE_MASK_WAITFORINPUTIDLE= $02000000;
  348. //endif (_WIN32_IE >= 0x500)
  349. //if (_WIN32_IE >= 0x0560)
  350. SEE_MASK_FLAG_LOG_USAGE = $04000000;
  351. //endif
  352. { (_WIN32_IE >= 0x560) }
  353. type
  354. _SHELLEXECUTEINFOA = record
  355. cbSize : DWORD;
  356. fMask : ULONG;
  357. hwnd : HWND;
  358. lpVerb : LPCSTR;
  359. lpFile : LPCSTR;
  360. lpParameters : LPCSTR;
  361. lpDirectory : LPCSTR;
  362. nShow : longint;
  363. hInstApp : HINST;
  364. lpIDList : LPVOID;
  365. lpClass : LPCSTR;
  366. hkeyClass : HKEY;
  367. dwHotKey : DWORD;
  368. DUMMYUNIONNAME : record
  369. case longint of
  370. 0 : ( hIcon : HANDLE );
  371. 1 : ( hMonitor : HANDLE );
  372. end;
  373. hProcess : HANDLE;
  374. end;
  375. SHELLEXECUTEINFOA = _SHELLEXECUTEINFOA;
  376. TSHELLEXECUTEINFOA = _SHELLEXECUTEINFOA;
  377. LPSHELLEXECUTEINFOA = ^_SHELLEXECUTEINFOA;
  378. _SHELLEXECUTEINFOW = record
  379. cbSize : DWORD;
  380. fMask : ULONG;
  381. hwnd : HWND;
  382. lpVerb : lpcwstr;
  383. lpFile : lpcwstr;
  384. lpParameters : lpcwstr;
  385. lpDirectory : lpcwstr;
  386. nShow : longint;
  387. hInstApp : HINST;
  388. lpIDList : LPVOID;
  389. lpClass : LPCWSTR;
  390. hkeyClass : HKEY;
  391. dwHotKey : DWORD;
  392. DUMMYUNIONNAME : record
  393. case longint of
  394. 0 : ( hIcon : HANDLE );
  395. 1 : ( hMonitor : HANDLE );
  396. end;
  397. hProcess : HANDLE;
  398. end;
  399. SHELLEXECUTEINFOW = _SHELLEXECUTEINFOW;
  400. TSHELLEXECUTEINFOW = _SHELLEXECUTEINFOW;
  401. LPSHELLEXECUTEINFOW = ^_SHELLEXECUTEINFOW;
  402. {$ifdef UNICODE}
  403. SHELLEXECUTEINFO = SHELLEXECUTEINFOW;
  404. TSHELLEXECUTEINFO = SHELLEXECUTEINFOW;
  405. LPSHELLEXECUTEINFO = LPSHELLEXECUTEINFOW;
  406. {$else}
  407. SHELLEXECUTEINFO = SHELLEXECUTEINFOA;
  408. TSHELLEXECUTEINFO = SHELLEXECUTEINFOA;
  409. LPSHELLEXECUTEINFO = LPSHELLEXECUTEINFOA;
  410. {$endif}
  411. Function ShellExecuteExA(lpExecInfo: LPSHELLEXECUTEINFOA):Bool;external 'shell32.dll' name 'ShellExecuteExA';
  412. Function ShellExecuteExW(lpExecInfo: LPSHELLEXECUTEINFOW):Bool;external 'shell32.dll' name 'ShellExecuteExW';
  413. Function ShellExecuteEx(lpExecInfo: LPSHELLEXECUTEINFOA):Bool;external 'shell32.dll' name 'ShellExecuteExA';
  414. Function ShellExecuteEx(lpExecInfo: LPSHELLEXECUTEINFOW):Bool;external 'shell32.dll' name 'ShellExecuteExW';
  415. Procedure WinExecErrorA(HWND : hwnd; error : Longint;lpstrFileName:LPCSTR; lpstrTitle:LPCSTR); external 'shell32.dll' name 'WinExecErrorA';
  416. Procedure WinExecErrorW(HWND : hwnd; error : Longint;lpstrFileName:LPCWSTR; lpstrTitle:LPCWSTR); external 'shell32.dll' name 'WinExecErrorW';
  417. Procedure WinExecError(HWND : hwnd; error : Longint;lpstrFileName:LPCSTR; lpstrTitle:LPCSTR); external 'shell32.dll' name 'WinExecErrorA';
  418. Procedure WinExecError(HWND : hwnd; error : Longint;lpstrFileName:LPCWSTR; lpstrTitle:LPCWSTR); external 'shell32.dll' name 'WinExecErrorW';
  419. type
  420. _SHCREATEPROCESSINFOW = record
  421. cbSize : DWORD;
  422. fMask : ULONG;
  423. hwnd : HWND;
  424. pszFile : LPCWSTR;
  425. pszParameters : LPCWSTR;
  426. pszCurrentDirectory : LPCWSTR;
  427. {in} hUserToken : HANDLE;
  428. {in} lpProcessAttributes : LPSECURITY_ATTRIBUTES;
  429. {in} lpThreadAttributes : LPSECURITY_ATTRIBUTES;
  430. {in} bInheritHandles : BOOL;
  431. {in} dwCreationFlags : DWORD;
  432. {in} lpStartupInfo : LPSTARTUPINFOW;
  433. {out} lpProcessInformation : LPPROCESS_INFORMATION;
  434. end;
  435. SHCREATEPROCESSINFOW = _SHCREATEPROCESSINFOW;
  436. TSHCREATEPROCESSINFOW = _SHCREATEPROCESSINFOW;
  437. PSHCREATEPROCESSINFOW = ^_SHCREATEPROCESSINFOW;
  438. Function SHCreateProcessAsUserW(pscpi : PSHCREATEPROCESSINFOW):Bool;external 'shell32.dll' name 'SHCreateProcessAsUserW';
  439. //
  440. // End ShellExecuteEx and family }
  441. //
  442. //
  443. // RecycleBin
  444. //
  445. { struct for query recycle bin info }
  446. Type
  447. _SHQUERYRBINFO = record
  448. cbSize : DWORD;
  449. i64Size : int64;
  450. i64NumItems : int64;
  451. end;
  452. SHQUERYRBINFO = _SHQUERYRBINFO;
  453. TSHQUERYRBINFO = _SHQUERYRBINFO;
  454. LPSHQUERYRBINFO = ^_SHQUERYRBINFO;
  455. { flags for SHEmptyRecycleBin }
  456. const
  457. SHERB_NOCONFIRMATION = $00000001;
  458. SHERB_NOPROGRESSUI = $00000002;
  459. SHERB_NOSOUND = $00000004;
  460. function SHQueryRecycleBinA(pszRootPath:LPCSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinA';
  461. function SHQueryRecycleBinW(pszRootPath:LPCWSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinW';
  462. function SHQueryRecycleBin(pszRootPath:LPCSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinA';
  463. function SHQueryRecycleBin(pszRootPath:LPCWSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinW';
  464. function SHEmptyRecycleBinA(hwnd:HWND; pszRootPath:LPCSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinA';
  465. function SHEmptyRecycleBinW(hwnd:HWND; pszRootPath:LPCWSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinW';
  466. function SHEmptyRecycleBin(hwnd:HWND; pszRootPath:LPCSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinA';
  467. function SHEmptyRecycleBin(hwnd:HWND; pszRootPath:LPCWSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinW';
  468. //
  469. // end of RecycleBin
  470. //
  471. //
  472. // Tray notification definitions
  473. //
  474. Type
  475. _NOTIFYICONDATAA = record
  476. cbSize : DWORD;
  477. hWnd : HWND;
  478. uID : UINT;
  479. uFlags : UINT;
  480. uCallbackMessage : UINT;
  481. hIcon : HICON;
  482. {$ifdef IELower5}
  483. szTip : array[0..63] of CHAR;
  484. {$else}
  485. szTip : array[0..127] of CHAR;
  486. {$endif}
  487. {$ifdef IEhigherEqual5}
  488. dwState : DWORD;
  489. dwStateMask : DWORD;
  490. szInfo : array[0..255] of CHAR;
  491. DUMMYUNIONNAME : record
  492. case longint of
  493. 0 : ( uTimeout : UINT );
  494. 1 : ( uVersion : UINT );
  495. end;
  496. szInfoTitle : array[0..63] of CHAR;
  497. dwInfoFlags : DWORD;
  498. {$endif}
  499. {$ifdef IEHighEq6}
  500. guidItem : GUID;
  501. {$endif}
  502. end;
  503. NOTIFYICONDATAA = _NOTIFYICONDATAA;
  504. TNOTIFYICONDATAA = _NOTIFYICONDATAA;
  505. PNOTIFYICONDATAA = ^_NOTIFYICONDATAA;
  506. _NOTIFYICONDATAW = record
  507. cbSize : DWORD;
  508. hWnd : HWND;
  509. uID : UINT;
  510. uFlags : UINT;
  511. uCallbackMessage : UINT;
  512. hIcon : HICON;
  513. {$ifdef IELower5}
  514. szTip : array[0..63] of WCHAR;
  515. {$else}
  516. szTip : array[0..127] of WCHAR;
  517. {$endif}
  518. {$ifdef IEhigherEqual5}
  519. dwState : DWORD;
  520. dwStateMask : DWORD;
  521. szInfo : array[0..255] of WCHAR;
  522. DUMMYUNIONNAME : record
  523. case longint of
  524. 0 : ( uTimeout : UINT );
  525. 1 : ( uVersion : UINT );
  526. end;
  527. szInfoTitle : array[0..63] of CHAR;
  528. dwInfoFlags : DWORD;
  529. {$endif}
  530. {$ifdef IEHighEq6}
  531. guidItem : GUID;
  532. {$endif}
  533. end;
  534. NOTIFYICONDATAW = _NOTIFYICONDATAW;
  535. TNOTIFYICONDATAW = _NOTIFYICONDATAW;
  536. PNOTIFYICONDATAW = ^_NOTIFYICONDATAW;
  537. {$ifdef UNICODE}
  538. NOTIFYICONDATA = NOTIFYICONDATAW;
  539. TNOTIFYICONDATA = NOTIFYICONDATAW;
  540. PNOTIFYICONDATA = PNOTIFYICONDATAW;
  541. {$else}
  542. NOTIFYICONDATA = NOTIFYICONDATAA;
  543. TNOTIFYICONDATA = NOTIFYICONDATAA;
  544. PNOTIFYICONDATA = PNOTIFYICONDATAA;
  545. {$endif}
  546. { UNICODE }
  547. {
  548. #define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAA, szTip[64])
  549. #define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAW, szTip[64])
  550. #ifdef UNICODE
  551. #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAW_V1_SIZE
  552. #else
  553. #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAA_V1_SIZE
  554. #endif
  555. #define NOTIFYICONDATAA_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAA, guidItem)
  556. #define NOTIFYICONDATAW_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAW, guidItem)
  557. #ifdef UNICODE
  558. #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAW_V2_SIZE
  559. #else
  560. #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAA_V2_SIZE
  561. #endif
  562. }
  563. const
  564. NIN_SELECT = WM_USER + 0;
  565. NINF_KEY = $1;
  566. NIN_KEYSELECT = NIN_SELECT or NINF_KEY;
  567. // if (_WIN32_IE >= 0x0501)}
  568. NIN_BALLOONSHOW = WM_USER + 2;
  569. NIN_BALLOONHIDE = WM_USER + 3;
  570. NIN_BALLOONTIMEOUT = WM_USER + 4;
  571. NIN_BALLOONUSERCLICK = WM_USER + 5;
  572. NIM_ADD = $00000000;
  573. NIM_MODIFY = $00000001;
  574. NIM_DELETE = $00000002;
  575. //if (_WIN32_IE >= 0x0500)}
  576. NIM_SETFOCUS = $00000003;
  577. NIM_SETVERSION = $00000004;
  578. NOTIFYICON_VERSION = 3;
  579. NIF_MESSAGE = $00000001;
  580. NIF_ICON = $00000002;
  581. NIF_TIP = $00000004;
  582. // if (_WIN32_IE >= 0x0500)}
  583. NIF_STATE = $00000008;
  584. NIF_INFO = $00000010;
  585. //if (_WIN32_IE >= 0x600)}
  586. NIF_GUID = $00000020;
  587. //if (_WIN32_IE >= 0x0500)}
  588. NIS_HIDDEN = $00000001;
  589. NIS_SHAREDICON = $00000002;
  590. { says this is the source of a shared icon }
  591. { Notify Icon Infotip flags }
  592. NIIF_NONE = $00000000;
  593. { icon flags are mutually exclusive }
  594. { and take only the lowest 2 bits }
  595. NIIF_INFO = $00000001;
  596. NIIF_WARNING = $00000002;
  597. NIIF_ERROR = $00000003;
  598. NIIF_ICON_MASK = $0000000F;
  599. //if (_WIN32_IE >= 0x0501)}
  600. NIIF_NOSOUND = $00000010;
  601. Function Shell_NotifyIconA( dwMessage: Dword;lpData: PNOTIFYICONDATAA):Bool;external 'shell32.dll' name 'Shell_NotifyIconA';
  602. Function Shell_NotifyIconW( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;external 'shell32.dll' name 'Shell_NotifyIconW';
  603. Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAA):Bool;external 'shell32.dll' name 'Shell_NotifyIconA';
  604. Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;external 'shell32.dll' name 'Shell_NotifyIconW';
  605. //
  606. // End Tray Notification Icons
  607. //
  608. //
  609. // Begin SHGetFileInfo
  610. //
  611. {
  612. The SHGetFileInfo API provides an easy way to get attributes
  613. for a file given a pathname.
  614. PARAMETERS
  615. pszPath file name to get info about
  616. dwFileAttributes file attribs, only used with SHGFI_USEFILEATTRIBUTES
  617. psfi place to return file info
  618. cbFileInfo size of structure
  619. uFlags flags
  620. RETURN
  621. TRUE if things worked
  622. }
  623. { out: icon }
  624. { out: icon index }
  625. { out: SFGAO_ flags }
  626. { out: display name (or path) }
  627. { out: type name }
  628. type
  629. _SHFILEINFOA = record
  630. hIcon : HICON; { out: icon }
  631. iIcon : longint; { out: icon index }
  632. dwAttributes : DWORD; { out: SFGAO_ flags }
  633. szDisplayName : array[0..(MAX_PATH)-1] of CHAR; { out: display name (or path) }
  634. szTypeName : array[0..79] of CHAR; { out: type name }
  635. end;
  636. SHFILEINFOA = _SHFILEINFOA;
  637. TSHFILEINFOA = _SHFILEINFOA;
  638. pSHFILEINFOA = ^_SHFILEINFOA;
  639. _SHFILEINFOW = record
  640. hIcon : HICON; { out: icon }
  641. iIcon : longint; { out: icon index }
  642. dwAttributes : DWORD; { out: SFGAO_ flags }
  643. szDisplayName : array[0..(MAX_PATH)-1] of WCHAR;{ out: display name (or path) }
  644. szTypeName : array[0..79] of WCHAR; { out: type name }
  645. end;
  646. SHFILEINFOW = _SHFILEINFOW;
  647. TSHFILEINFOW = _SHFILEINFOW;
  648. pSHFILEINFOW = ^_SHFILEINFOW;
  649. {$ifdef UNICODE}
  650. SHFILEINFO = SHFILEINFOW;
  651. TSHFILEINFO = SHFILEINFOW;
  652. pFILEINFO = SHFILEINFOW;
  653. {$else}
  654. SHFILEINFO = SHFILEINFOA;
  655. TSHFILEINFO = SHFILEINFOA;
  656. pFILEINFO = SHFILEINFOA;
  657. {$endif}
  658. { NOTE: This is also in shlwapi.h. Please keep in synch. }
  659. const
  660. SHGFI_ICON = $000000100; { get Icon}
  661. SHGFI_DISPLAYNAME = $000000200; { get display name }
  662. SHGFI_TYPENAME = $000000400; { get type name }
  663. SHGFI_ATTRIBUTES = $000000800; { get attributes }
  664. SHGFI_ICONLOCATION = $000001000; { get icon location}
  665. SHGFI_EXETYPE = $000002000; { return exe type }
  666. SHGFI_SYSICONINDEX = $000004000; { get system icon index }
  667. SHGFI_LINKOVERLAY = $000008000; { put a link overlay on icon }
  668. SHGFI_SELECTED = $000010000; { show icon in selected state }
  669. SHGFI_ATTR_SPECIFIED = $000020000; { get only specified attributes }
  670. SHGFI_LARGEICON = $000000000; { get large icon }
  671. SHGFI_SMALLICON = $000000001; { get small icon }
  672. SHGFI_OPENICON = $000000002; { get open icon }
  673. SHGFI_SHELLICONSIZE = $000000004; { get shell size icon }
  674. SHGFI_PIDL = $000000008; { pszPath is a pidl }
  675. SHGFI_USEFILEATTRIBUTES = $000000010; { use passed dwFileAttribute }
  676. //if (_WIN32_IE >= 0x0500)}
  677. SHGFI_ADDOVERLAYS = $000000020; { apply the appropriate overlays }
  678. SHGFI_OVERLAYINDEX = $000000040; { Get the index of the overlay }
  679. { in the upper 8 bits of the iIcon }
  680. Function SHGetFileInfoA(pszPath: LPCSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
  681. Function SHGetFileInfoW(pszPath: LPCWSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoW';
  682. Function SHGetFileInfo(pszPath: LPCSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
  683. Function SHGetFileInfoA(pszPath: LPCSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
  684. Function SHGetFileInfoW(pszPath: LPCWSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoW';
  685. Function SHGetFileInfo(pszPath: LPCSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
  686. Function SHGetFileInfo(pszPath: LPCWSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoW';
  687. Function SHGetDiskFreeSpaceExA( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExA';
  688. Function SHGetDiskFreeSpaceExW( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExW';
  689. Function SHGetDiskFreeSpaceEx( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExA';
  690. Function SHGetDiskFreeSpace( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExA';
  691. Function SHGetDiskFreeSpaceEx( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExW';
  692. Function SHGetDiskFreeSpace( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExW';
  693. Function SHGetNewLinkInfoA(pszLinkTo:LPCSTR;pszDir:LPCSTR; pszName:LPSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoA';
  694. Function SHGetNewLinkInfoW(pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoW';
  695. Function SHGetNewLinkInfo (pszLinkTo:LPCSTR;pszDir:LPCSTR; pszName:LPSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoA';
  696. Function SHGetNewLinkInfo (pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoW';
  697. const
  698. SHGNLI_PIDL = $000000001; { pszLinkTo is a pidl }
  699. SHGNLI_PREFIXNAME = $000000002; { Make name "Shortcut to xxx" }
  700. SHGNLI_NOUNIQUE = $000000004; { don't do the unique name generation }
  701. // {if (_WIN32_IE >= 0x0501)}
  702. SHGNLI_NOLNK = $000000008; { don't add ".lnk" extension }
  703. // {$endif}
  704. { _WIN2_IE >= 0x0501 }
  705. //
  706. // End SHGetFileInfo
  707. //
  708. { Printer stuff }
  709. PRINTACTION_OPEN = 0;
  710. PRINTACTION_PROPERTIES = 1;
  711. PRINTACTION_NETINSTALL = 2;
  712. PRINTACTION_NETINSTALLLINK = 3;
  713. PRINTACTION_TESTPAGE = 4;
  714. PRINTACTION_OPENNETPRN = 5;
  715. {$ifdef WINNT}
  716. PRINTACTION_DOCUMENTDEFAULTS = 6;
  717. PRINTACTION_SERVERPROPERTIES = 7;
  718. {$endif}
  719. Function SHInvokePrinterCommandA(HWND: hwnd; uAction:UINT; lpBuf1: LPCSTR; lpBuf2: LPCSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandA';
  720. Function SHInvokePrinterCommandW(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf2: LPCWSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandW';
  721. Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCSTR; lpBuf2: LPCSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandA';
  722. Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf2: LPCWSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandW';
  723. // WINVER >= 0x0400
  724. //if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
  725. //
  726. // The SHLoadNonloadedIconOverlayIdentifiers API causes the shell's
  727. // icon overlay manager to load any registered icon overlay
  728. // identifers that are not currently loaded. This is useful if an
  729. // overlay identifier did not load at shell startup but is needed
  730. // and can be loaded at a later time. Identifiers already loaded
  731. // are not affected. Overlay identifiers implement the
  732. // IShellIconOverlayIdentifier interface.
  733. //
  734. // Returns:
  735. // S_OK
  736. //
  737. function SHLoadNonloadedIconOverlayIdentifiers:HResult; external 'shell32.dll' name 'SHInvokePrinterCommandW';
  738. //
  739. // The SHIsFileAvailableOffline API determines whether a file
  740. // or folder is available for offline use.
  741. //
  742. // Parameters:
  743. // pwszPath file name to get info about
  744. // pdwStatus (optional) OFFLINE_STATUS_* flags returned here
  745. //
  746. // Returns:
  747. // S_OK File/directory is available offline, unless
  748. // OFFLINE_STATUS_INCOMPLETE is returned.
  749. // E_INVALIDARG Path is invalid, or not a net path
  750. // E_FAIL File/directory is not available offline
  751. //
  752. // Notes:
  753. // OFFLINE_STATUS_INCOMPLETE is never returned for directories.
  754. // Both OFFLINE_STATUS_LOCAL and OFFLINE_STATUS_REMOTE may be returned,
  755. // indicating "open in both places." This is common when the server is online.
  756. //
  757. function SHIsFileAvailableOffline(pwszPath:LPCWSTR; pdwStatus:LPDWORD):HRESULT; external 'shell32.dll' name 'SHIsFileAvailableOffline';
  758. const
  759. OFFLINE_STATUS_LOCAL = $0001; { If open, it's open locally }
  760. OFFLINE_STATUS_REMOTE = $0002; { If open, it's open remotely }
  761. OFFLINE_STATUS_INCOMPLETE = $0004; { The local copy is currently incomplete. }
  762. { The file will not be available offline }
  763. { until it has been synchronized. }
  764. { sets the specified path to use the string resource }
  765. { as the UI instead of the file system name }
  766. function SHSetLocalizedName(pszPath:LPWSTR; pszResModule:LPCWSTR; idsRes:longint):HRESULT;external 'shell32.dll' name 'SHSetLocalizedName';
  767. //if _WIN32_IE >= 0x0600}
  768. function SHEnumerateUnreadMailAccountsA(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPSTR; cchMailAddress:longint):HRESULT;external 'shell32.dll' name 'SHEnumerateUnreadMailAccountsA';
  769. function SHEnumerateUnreadMailAccountsW(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPWSTR; cchMailAddress:longint):HRESULT;external 'shell32.dll' name 'SHEnumerateUnreadMailAccountsW';
  770. function SHEnumerateUnreadMailAccounts(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPWSTR; cchMailAddress:longint):HRESULT;external 'shell32.dll' name 'SHEnumerateUnreadMailAccountsW';
  771. function SHGetUnreadMailCountA(hKeyUser:HKEY; pszMailAddress:LPCSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountA';
  772. function SHGetUnreadMailCountW(hKeyUser:HKEY; pszMailAddress:LPCWSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPWSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountW';
  773. function SHGetUnreadMailCount(hKeyUser:HKEY; pszMailAddress:LPCSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountA';
  774. function SHGetUnreadMailCount(hKeyUser:HKEY; pszMailAddress:LPCWSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPWSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountW';
  775. function SHSetUnreadMailCountA(pszMailAddress:LPCSTR; dwCount:DWORD; pszShellExecuteCommand:LPCSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountA';
  776. function SHSetUnreadMailCountW(pszMailAddress:LPCWSTR; dwCount:DWORD; pszShellExecuteCommand:LPCWSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountW';
  777. function SHSetUnreadMailCount(pszMailAddress:LPCSTR; dwCount:DWORD; pszShellExecuteCommand:LPCSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountA';
  778. function SHSetUnreadMailCount(pszMailAddress:LPCWSTR; dwCount:DWORD; pszShellExecuteCommand:LPCWSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountW';
  779. // _WIN32_IE >= 0x0600 }
  780. // if _WIN32_IE >= 0x0600}
  781. function SHGetImageList(iImageList:longint;CONST riid:TIID; ppvObj:Ppointer):HRESULT;external 'shell32.dll' name 'SHGetImageList';
  782. Const
  783. SHIL_LARGE = 0; { normally 32x32 }
  784. SHIL_SMALL = 1; { normally 16x16 }
  785. SHIL_EXTRALARGE = 2;
  786. SHIL_SYSSMALL = 3; { like SHIL_SMALL, but tracks system small icon metric correctly }
  787. SHIL_LAST = SHIL_SYSSMALL;
  788. { Function call types for ntshrui folder sharing helpers }
  789. //typedef HRESULT (STDMETHODCALLTYPE *PFNSHOWSHAREFOLDERUIW)(IN HWND hwndParent, IN LPCSTR pszPath);
  790. //typedef HRESULT (STDMETHODCALLTYPE *PFNSHOWSHAREFOLDERUIW)(IN HWND hwndParent, IN LPCWSTR pszPath);
  791. implementation
  792. function EIRESID(x : longint) : longint;
  793. Begin
  794. EIRESID:=-x;
  795. End;
  796. end.
  797. {
  798. $Log$
  799. Revision 1.8 2005-02-14 17:13:32 peter
  800. * truncate log
  801. Revision 1.7 2005/02/03 20:48:56 florian
  802. * fixed SHGetFileInfo
  803. }