shellapi.pp 47 KB

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