* Shell32 (a forked module) was jealous because of shlwapi getting synced.
[reactos.git] / reactos / dll / win32 / shell32 / undocshell.h
1 /*
2 * Copyright 1999, 2000 Juergen Schmied
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library 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. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef __WINE_UNDOCSHELL_H
20 #define __WINE_UNDOCSHELL_H
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "commctrl.h"
28 #include "shlobj.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* defined(__cplusplus) */
33
34 /****************************************************************************
35 * IDList Functions
36 */
37 BOOL WINAPI ILGetDisplayName(
38 LPCITEMIDLIST pidl,
39 LPVOID path);
40
41 /* type parameter for ILGetDisplayNameEx() */
42 #define ILGDN_FORPARSING 0
43 #define ILGDN_NORMAL 1
44 #define ILGDN_INFOLDER 2
45
46 BOOL WINAPI ILGetDisplayNameEx(
47 LPSHELLFOLDER psf,
48 LPCITEMIDLIST pidl,
49 LPVOID path,
50 DWORD type);
51
52 LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
53 void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
54 LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME
55 LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
56
57 HRESULT WINAPI SHILCreateFromPathA (
58 LPCSTR path,
59 LPITEMIDLIST * ppidl,
60 DWORD *attributes);
61
62 HRESULT WINAPI SHILCreateFromPathW (
63 LPCWSTR path,
64 LPITEMIDLIST * ppidl,
65 DWORD *attributes);
66
67 /*
68 string functions
69 */
70 BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
71 BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
72
73
74 /****************************************************************************
75 * SHChangeNotifyRegister API
76 */
77 #define SHCNRF_InterruptLevel 0x0001
78 #define SHCNRF_ShellLevel 0x0002
79 #define SHCNRF_RecursiveInterrupt 0x1000 /* Must be combined with SHCNRF_InterruptLevel */
80 #define SHCNRF_NewDelivery 0x8000 /* Messages use shared memory */
81
82
83 /****************************************************************************
84 * Shell Common Dialogs
85 */
86
87 /* RunFileDlg flags */
88 #define RFF_NOBROWSE 0x01
89 #define RFF_NODEFAULT 0x02
90 #define RFF_CALCDIRECTORY 0x04
91 #define RFF_NOLABEL 0x08
92 #define RFF_NOSEPARATEMEM 0x20 /* NT only */
93
94 #define DE_SAMEFILE 0x71
95
96 /* RunFileFlg notification structure */
97 typedef struct
98 {
99 NMHDR hdr;
100 LPCSTR lpFile;
101 LPCSTR lpDirectory;
102 int nShow;
103 } NM_RUNFILEDLG, * LPNM_RUNFILEDLG;
104
105 /* RunFileDlg notification return values */
106 #define RF_OK 0x00
107 #define RF_CANCEL 0x01
108 #define RF_RETRY 0x02
109
110 void WINAPI RunFileDlg(
111 HWND hwndOwner,
112 HICON hIcon,
113 LPCWSTR lpstrDirectory,
114 LPCWSTR lpstrTitle,
115 LPCWSTR lpstrDescription,
116 UINT uFlags);
117
118 void WINAPI ExitWindowsDialog(HWND hwndOwner);
119
120 BOOL WINAPI SHFindComputer(
121 LPCITEMIDLIST pidlRoot,
122 LPCITEMIDLIST pidlSavedSearch);
123
124 void WINAPI SHHandleDiskFull(HWND hwndOwner,
125 UINT uDrive);
126
127 int WINAPI SHOutOfMemoryMessageBox(
128 HWND hwndOwner,
129 LPCSTR lpCaption,
130 UINT uType);
131
132 DWORD WINAPI SHNetConnectionDialog(
133 HWND hwndOwner,
134 LPCWSTR lpstrRemoteName,
135 DWORD dwType);
136
137 /****************************************************************************
138 * Memory Routines
139 */
140
141 /* The Platform SDK's shlobj.h header defines similar functions with a
142 * leading underscore. However those are unusable because of the leading
143 * underscore, because they have an incorrect calling convention, and
144 * because these functions are not exported by name anyway.
145 */
146 HANDLE WINAPI SHAllocShared(
147 LPVOID pv,
148 ULONG cb,
149 DWORD pid);
150
151 BOOL WINAPI SHFreeShared(
152 HANDLE hMem,
153 DWORD pid);
154
155 LPVOID WINAPI SHLockShared(
156 HANDLE hMem,
157 DWORD pid);
158
159 BOOL WINAPI SHUnlockShared(LPVOID pv);
160
161 /****************************************************************************
162 * Cabinet Window Messages
163 */
164
165 #define CWM_SETPATH (WM_USER + 2)
166 #define CWM_WANTIDLE (WM_USER + 3)
167 #define CWM_GETSETCURRENTINFO (WM_USER + 4)
168 #define CWM_SELECTITEM (WM_USER + 5)
169 #define CWM_SELECTITEMSTR (WM_USER + 6)
170 #define CWM_GETISHELLBROWSER (WM_USER + 7)
171 #define CWM_TESTPATH (WM_USER + 9)
172 #define CWM_STATECHANGE (WM_USER + 10)
173 #define CWM_GETPATH (WM_USER + 12)
174
175 /* CWM_TESTPATH types */
176 #define CWTP_ISEQUAL 0
177 #define CWTP_ISCHILD 1
178
179 /* CWM_TESTPATH structure */
180 typedef struct
181 {
182 DWORD dwType;
183 ITEMIDLIST idl;
184 } CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
185
186 /****************************************************************************
187 * System Imagelist Routines
188 */
189
190 int WINAPI Shell_GetCachedImageIndexA(
191 LPCSTR lpszFileName,
192 int nIconIndex,
193 UINT bSimulateDoc);
194
195 BOOL WINAPI Shell_GetImageLists(
196 HIMAGELIST *lphimlLarge,
197 HIMAGELIST *lphimlSmall);
198
199 HICON WINAPI SHGetFileIcon(
200 DWORD dwReserved,
201 LPCSTR lpszPath,
202 DWORD dwFileAttributes,
203 UINT uFlags);
204
205 BOOL WINAPI FileIconInit(BOOL bFullInit);
206
207 /****************************************************************************
208 * File Menu Routines
209 */
210 /* FileMenu_Create nSelHeight constants */
211 #define FM_DEFAULT_SELHEIGHT -1
212 #define FM_FULL_SELHEIGHT 0
213
214 /* FileMenu_Create flags */
215 #define FMF_SMALL_ICONS 0x00
216 #define FMF_LARGE_ICONS 0x08
217 #define FMF_NO_COLUMN_BREAK 0x10
218
219 HMENU WINAPI FileMenu_Create(
220 COLORREF crBorderColor,
221 int nBorderWidth,
222 HBITMAP hBorderBmp,
223 int nSelHeight,
224 UINT uFlags);
225
226 void WINAPI FileMenu_Destroy(HMENU hMenu);
227
228 /* FileMenu_AppendItem constants */
229 #define FM_SEPARATOR (LPCSTR)1
230 #define FM_BLANK_ICON -1
231 #define FM_DEFAULT_HEIGHT 0
232
233 BOOL WINAPI FileMenu_AppendItem(
234 HMENU hMenu,
235 LPCSTR lpszText,
236 UINT uID,
237 int iIcon,
238 HMENU hMenuPopup,
239 int nItemHeight);
240
241 /* FileMenu_InsertUsingPidl flags */
242 #define FMF_NO_EMPTY_ITEM 0x01
243 #define FMF_NO_PROGRAM_GROUPS 0x04
244
245 /* FileMenu_InsertUsingPidl callback function */
246 typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
247
248 int WINAPI FileMenu_InsertUsingPidl(
249 HMENU hMenu,
250 UINT uID,
251 LPCITEMIDLIST pidl,
252 UINT uFlags,
253 UINT uEnumFlags,
254 LPFNFMCALLBACK lpfnCallback);
255
256 int WINAPI FileMenu_ReplaceUsingPidl(
257 HMENU hMenu,
258 UINT uID,
259 LPCITEMIDLIST pidl,
260 UINT uEnumFlags,
261 LPFNFMCALLBACK lpfnCallback);
262
263 void WINAPI FileMenu_Invalidate(HMENU hMenu);
264
265 HMENU WINAPI FileMenu_FindSubMenuByPidl(
266 HMENU hMenu,
267 LPCITEMIDLIST pidl);
268
269 BOOL WINAPI FileMenu_TrackPopupMenuEx(
270 HMENU hMenu,
271 UINT uFlags,
272 int x,
273 int y,
274 HWND hWnd,
275 LPTPMPARAMS lptpm);
276
277 BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
278 UINT uReserved,
279 LPCITEMIDLIST *ppidlFolder,
280 LPCITEMIDLIST *ppidlItem);
281
282 LRESULT WINAPI FileMenu_MeasureItem(
283 HWND hWnd,
284 LPMEASUREITEMSTRUCT lpmis);
285
286 LRESULT WINAPI FileMenu_DrawItem(
287 HWND hWnd,
288 LPDRAWITEMSTRUCT lpdis);
289
290 BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
291
292 void WINAPI FileMenu_AbortInitMenu(void);
293
294 LRESULT WINAPI FileMenu_HandleMenuChar(
295 HMENU hMenu,
296 WPARAM wParam);
297
298 BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
299
300 BOOL WINAPI FileMenu_DeleteItemByCmd(
301 HMENU hMenu,
302 UINT uID);
303
304 BOOL WINAPI FileMenu_DeleteItemByIndex(
305 HMENU hMenu,
306 UINT uPos);
307
308 BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
309 HMENU hMenu,
310 UINT uID);
311
312 BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
313
314 BOOL WINAPI FileMenu_EnableItemByCmd(
315 HMENU hMenu,
316 UINT uID,
317 BOOL bEnable);
318
319 DWORD WINAPI FileMenu_GetItemExtent(
320 HMENU hMenu,
321 UINT uPos);
322
323 int WINAPI FileMenu_AppendFilesForPidl(
324 HMENU hMenu,
325 LPCITEMIDLIST pidl,
326 BOOL bAddSeparator);
327
328 int WINAPI FileMenu_AddFilesForPidl(
329 HMENU hMenu,
330 UINT uReserved,
331 UINT uID,
332 LPCITEMIDLIST pidl,
333 UINT uFlags,
334 UINT uEnumFlags,
335 LPFNFMCALLBACK lpfnCallback);
336
337 /****************************************************************************
338 * Drag And Drop Routines
339 */
340
341 HRESULT WINAPI SHRegisterDragDrop(
342 HWND hWnd,
343 LPDROPTARGET lpDropTarget);
344
345 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
346
347 BOOL WINAPI DAD_DragEnter(HWND hWnd);
348
349 BOOL WINAPI DAD_SetDragImageFromListView(
350 HWND hWnd,
351 POINT pt);
352
353 BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
354
355 /****************************************************************************
356 * Path Manipulation Routines
357 */
358
359 BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
360
361 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
362
363 LPVOID WINAPI PathAddBackslashAW(LPVOID path);
364
365 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
366
367 LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
368
369 LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
370
371 LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2);
372
373 LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
374
375 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
376
377 void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
378
379 VOID WINAPI PathQuoteSpacesAW(LPVOID path);
380
381 void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
382
383 BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
384
385 BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
386
387 BOOL WINAPI PathIsRootAW(LPCVOID x);
388
389 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
390
391 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
392
393 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
394
395 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
396
397 BOOL WINAPI PathMakeUniqueNameAW(
398 LPVOID lpszBuffer,
399 DWORD dwBuffSize,
400 LPCVOID lpszShortName,
401 LPCVOID lpszLongName,
402 LPCVOID lpszPathName);
403
404 BOOL WINAPI PathYetAnotherMakeUniqueName(
405 LPWSTR lpszBuffer,
406 LPCWSTR lpszPathName,
407 LPCWSTR lpszShortName,
408 LPCWSTR lpszLongName);
409
410 BOOL WINAPI PathQualifyAW(LPCVOID path);
411
412
413 /* PathResolve flags */
414 #define PRF_CHECKEXISTANCE 0x01
415 #define PRF_EXECUTABLE 0x02
416 #define PRF_QUALIFYONPATH 0x04
417 #define PRF_WINDOWS31 0x08
418
419 BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
420
421 VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
422
423 /* PathProcessCommand flags */
424 #define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */
425 #define PPCF_INCLUDEARGS 0x02
426 //#define PPCF_NODIRECTORIES 0x10 move to shlobj
427 #define PPCF_DONTRESOLVE 0x20
428 #define PPCF_PATHISRELATIVE 0x40
429
430 HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
431 DWORD dwBuffSize, DWORD dwFlags);
432
433 void WINAPI PathStripPathAW(LPVOID lpszPath);
434
435 BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
436
437 void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
438
439 void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
440
441 int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
442
443 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
444
445 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID *sOtherDirs);
446
447 /****************************************************************************
448 * Shell Namespace Routines
449 */
450
451 /* Generic structure used by several messages */
452 typedef struct
453 {
454 DWORD dwReserved;
455 DWORD dwReserved2;
456 LPCITEMIDLIST pidl;
457 LPDWORD lpdwUser;
458 } SFVCBINFO, * LPSFVCBINFO;
459 typedef const SFVCBINFO * LPCSFVCBINFO;
460
461 /* SFVCB_SELECTIONCHANGED structure */
462 typedef struct
463 {
464 UINT uOldState;
465 UINT uNewState;
466 LPCITEMIDLIST pidl;
467 LPDWORD lpdwUser;
468 } SFVSELECTSTATE, * LPSFVSELECTSTATE;
469 typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
470
471 /* SFVCB_COPYHOOKCALLBACK structure */
472 typedef struct
473 {
474 HWND hwnd;
475 UINT wFunc;
476 UINT wFlags;
477 LPCSTR pszSrcFile;
478 DWORD dwSrcAttribs;
479 LPCSTR pszDestFile;
480 DWORD dwDestAttribs;
481 } SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
482 typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
483
484 /* SFVCB_GETDETAILSOF structure */
485 typedef struct
486 {
487 LPCITEMIDLIST pidl;
488 int fmt;
489 int cx;
490 STRRET lpText;
491 } SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
492
493 /****************************************************************************
494 * Misc Stuff
495 */
496
497 /* SHWaitForFileToOpen flags */
498 #define SHWFF_ADD 0x01
499 #define SHWFF_REMOVE 0x02
500 #define SHWFF_WAIT 0x04
501
502 BOOL WINAPI SHWaitForFileToOpen(
503 LPCITEMIDLIST pidl,
504 DWORD dwFlags,
505 DWORD dwTimeout);
506
507 WORD WINAPI ArrangeWindows(
508 HWND hwndParent,
509 DWORD dwReserved,
510 LPCRECT lpRect,
511 WORD cKids,
512 CONST HWND * lpKids);
513
514 /* RegisterShellHook types */
515 #define RSH_DEREGISTER 0
516 #define RSH_REGISTER 1
517 #define RSH_REGISTER_PROGMAN 2
518 #define RSH_REGISTER_TASKMAN 3
519
520 BOOL WINAPI RegisterShellHook(
521 HWND hWnd,
522 DWORD dwType);
523
524 /* SHCreateDefClassObject callback function */
525 typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
526 LPUNKNOWN pUnkOuter,
527 REFIID riidObject,
528 LPVOID *ppvObject);
529
530 HRESULT WINAPI SHCreateDefClassObject(
531 REFIID riidFactory,
532 LPVOID *ppvFactory,
533 LPFNCDCOCALLBACK lpfnCallback,
534 LPDWORD lpdwUsage,
535 REFIID riidObject);
536
537 void WINAPI SHFreeUnusedLibraries(void);
538
539 /* SHCreateLinks flags */
540 #define SHCLF_PREFIXNAME 0x01
541 #define SHCLF_CREATEONDESKTOP 0x02
542
543 HRESULT WINAPI SHCreateLinks(
544 HWND hWnd,
545 LPCSTR lpszDir,
546 LPDATAOBJECT lpDataObject,
547 UINT uFlags,
548 LPITEMIDLIST *lppidlLinks);
549
550 DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len);
551 DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
552
553 /* policy functions */
554 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
555
556 /* Shell Desktop functions */
557
558 #define WM_GETISHELLBROWSER (WM_USER+7)
559
560 BOOL WINAPI SHDesktopMessageLoop(HANDLE);
561
562 #define CSIDL_FOLDER_MASK 0x00ff
563
564 #ifdef __cplusplus
565 } /* extern "C" */
566 #endif /* defined(__cplusplus) */
567
568 #endif /* __WINE_UNDOCSHELL_H */