shellapi.pp 47 KB

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