shellapi.pp 47 KB

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