shellapi.pp 46 KB

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