shellapi.pp 47 KB

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