shellapi.pp 47 KB

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