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