[ATL] Add CHAIN_MSG_MAP macro
[reactos.git] / sdk / include / reactos / 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 #ifdef __cplusplus
23 extern "C" {
24 #endif /* defined(__cplusplus) */
25
26
27 #if (NTDDI_VERSION < NTDDI_LONGHORN)
28 #define DBIMF_NOGRIPPER 0x0800
29 #define DBIMF_ALWAYSGRIPPER 0x1000
30 #define DBIMF_NOMARGINS 0x2000
31 #endif // NTDDI_LONGHORN
32
33 /****************************************************************************
34 * Taskbar WM_COMMAND identifiers
35 */
36
37 #define TWM_DOEXITWINDOWS (WM_USER + 342)
38 #define TWM_CYCLEFOCUS (WM_USER + 348)
39
40
41 /****************************************************************************
42 * IDList Functions
43 */
44 BOOL WINAPI ILGetDisplayName(
45 LPCITEMIDLIST pidl,
46 LPVOID path);
47
48 /* type parameter for ILGetDisplayNameEx() */
49 #define ILGDN_FORPARSING 0
50 #define ILGDN_NORMAL 1
51 #define ILGDN_INFOLDER 2
52
53 BOOL WINAPI ILGetDisplayNameEx(
54 LPSHELLFOLDER psf,
55 LPCITEMIDLIST pidl,
56 LPVOID path,
57 DWORD type);
58
59 LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
60 void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
61 LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME
62 LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
63
64 HRESULT WINAPI SHILCreateFromPathA (
65 LPCSTR path,
66 LPITEMIDLIST * ppidl,
67 DWORD *attributes);
68
69 HRESULT WINAPI SHILCreateFromPathW (
70 LPCWSTR path,
71 LPITEMIDLIST * ppidl,
72 DWORD *attributes);
73
74 /*
75 string functions
76 */
77 BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
78 BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
79
80
81 /****************************************************************************
82 * SHChangeNotifyRegister API
83 */
84 #define SHCNRF_InterruptLevel 0x0001
85 #define SHCNRF_ShellLevel 0x0002
86 #define SHCNRF_RecursiveInterrupt 0x1000 /* Must be combined with SHCNRF_InterruptLevel */
87 #define SHCNRF_NewDelivery 0x8000 /* Messages use shared memory */
88
89
90 /****************************************************************************
91 * Shell Common Dialogs
92 */
93
94 /* RunFileDlg flags */
95 #define RFF_NOBROWSE 0x01 /* Removes the browse button */
96 #define RFF_NODEFAULT 0x02 /* No default item selected */
97 #define RFF_CALCDIRECTORY 0x04 /* Calculates the working directory from the file name */
98 #define RFF_NOLABEL 0x08 /* Removes the edit box label */
99 #define RFF_NOSEPARATEMEM 0x20 /* Removes the Separate Memory Space check box (Windows NT only) */
100
101 /* RunFileFlg notification value and structure */
102 #define RFN_VALIDATE (-510)
103 #if 0 // Deprecated ANSI structure
104 typedef struct _NMRUNFILEDLGA
105 {
106 NMHDR hdr;
107 LPCSTR lpFile;
108 LPCSTR lpDirectory;
109 UINT nShow;
110 } NMRUNFILEDLGA, *PNMRUNFILEDLGA, *LPNMRUNFILEDLGA;
111 #endif
112 typedef struct _NMRUNFILEDLGW
113 {
114 NMHDR hdr;
115 LPCWSTR lpFile;
116 LPCWSTR lpDirectory;
117 UINT nShow;
118 } NMRUNFILEDLGW, *PNMRUNFILEDLGW, *LPNMRUNFILEDLGW;
119
120 typedef NMRUNFILEDLGW NMRUNFILEDLG;
121 typedef PNMRUNFILEDLGW PNMRUNFILEDLG;
122 typedef LPNMRUNFILEDLGW LPNMRUNFILEDLG;
123
124 /* RunFileDlg notification return values */
125 #define RF_OK 0x00
126 #define RF_CANCEL 0x01
127 #define RF_RETRY 0x02
128
129 void WINAPI RunFileDlg(
130 HWND hWndOwner,
131 HICON hIcon,
132 LPCWSTR lpstrDirectory,
133 LPCWSTR lpstrTitle,
134 LPCWSTR lpstrDescription,
135 UINT uFlags);
136
137 int WINAPI LogoffWindowsDialog(HWND hWndOwner);
138 void WINAPI ExitWindowsDialog(HWND hWndOwner);
139
140 BOOL WINAPI SHFindComputer(
141 LPCITEMIDLIST pidlRoot,
142 LPCITEMIDLIST pidlSavedSearch);
143
144 void WINAPI SHHandleDiskFull(HWND hwndOwner,
145 UINT uDrive);
146
147 int WINAPI SHOutOfMemoryMessageBox(
148 HWND hwndOwner,
149 LPCSTR lpCaption,
150 UINT uType);
151
152 DWORD WINAPI SHNetConnectionDialog(
153 HWND hwndOwner,
154 LPCWSTR lpstrRemoteName,
155 DWORD dwType);
156
157 /****************************************************************************
158 * Cabinet Window Messages
159 */
160
161 #define CWM_SETPATH (WM_USER + 2)
162 #define CWM_WANTIDLE (WM_USER + 3)
163 #define CWM_GETSETCURRENTINFO (WM_USER + 4)
164 #define CWM_SELECTITEM (WM_USER + 5)
165 #define CWM_SELECTITEMSTR (WM_USER + 6)
166 #define CWM_GETISHELLBROWSER (WM_USER + 7)
167 #define CWM_TESTPATH (WM_USER + 9)
168 #define CWM_STATECHANGE (WM_USER + 10)
169 #define CWM_GETPATH (WM_USER + 12)
170
171 #define WM_GETISHELLBROWSER CWM_GETISHELLBROWSER
172
173 /* CWM_TESTPATH types */
174 #define CWTP_ISEQUAL 0
175 #define CWTP_ISCHILD 1
176
177 /* CWM_TESTPATH structure */
178 typedef struct
179 {
180 DWORD dwType;
181 ITEMIDLIST idl;
182 } CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
183
184 /****************************************************************************
185 * System Imagelist Routines
186 */
187
188 int WINAPI Shell_GetCachedImageIndexA(
189 LPCSTR lpszFileName,
190 int nIconIndex,
191 UINT bSimulateDoc);
192
193 BOOL WINAPI Shell_GetImageLists(
194 HIMAGELIST *lphimlLarge,
195 HIMAGELIST *lphimlSmall);
196
197 HICON WINAPI SHGetFileIcon(
198 DWORD dwReserved,
199 LPCSTR lpszPath,
200 DWORD dwFileAttributes,
201 UINT uFlags);
202
203 BOOL WINAPI FileIconInit(BOOL bFullInit);
204
205 /****************************************************************************
206 * File Menu Routines
207 */
208 /* FileMenu_Create nSelHeight constants */
209 #define FM_DEFAULT_SELHEIGHT -1
210 #define FM_FULL_SELHEIGHT 0
211
212 /* FileMenu_Create flags */
213 #define FMF_SMALL_ICONS 0x00
214 #define FMF_LARGE_ICONS 0x08
215 #define FMF_NO_COLUMN_BREAK 0x10
216
217 HMENU WINAPI FileMenu_Create(
218 COLORREF crBorderColor,
219 int nBorderWidth,
220 HBITMAP hBorderBmp,
221 int nSelHeight,
222 UINT uFlags);
223
224 void WINAPI FileMenu_Destroy(HMENU hMenu);
225
226 /* FileMenu_AppendItem constants */
227 #define FM_SEPARATOR (LPCSTR)1
228 #define FM_BLANK_ICON -1
229 #define FM_DEFAULT_HEIGHT 0
230
231 BOOL WINAPI FileMenu_AppendItem(
232 HMENU hMenu,
233 LPCSTR lpszText,
234 UINT uID,
235 int iIcon,
236 HMENU hMenuPopup,
237 int nItemHeight);
238
239 /* FileMenu_InsertUsingPidl flags */
240 #define FMF_NO_EMPTY_ITEM 0x01
241 #define FMF_NO_PROGRAM_GROUPS 0x04
242
243 /* FileMenu_InsertUsingPidl callback function */
244 typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
245
246 int WINAPI FileMenu_InsertUsingPidl(
247 HMENU hMenu,
248 UINT uID,
249 LPCITEMIDLIST pidl,
250 UINT uFlags,
251 UINT uEnumFlags,
252 LPFNFMCALLBACK lpfnCallback);
253
254 int WINAPI FileMenu_ReplaceUsingPidl(
255 HMENU hMenu,
256 UINT uID,
257 LPCITEMIDLIST pidl,
258 UINT uEnumFlags,
259 LPFNFMCALLBACK lpfnCallback);
260
261 void WINAPI FileMenu_Invalidate(HMENU hMenu);
262
263 HMENU WINAPI FileMenu_FindSubMenuByPidl(
264 HMENU hMenu,
265 LPCITEMIDLIST pidl);
266
267 BOOL WINAPI FileMenu_TrackPopupMenuEx(
268 HMENU hMenu,
269 UINT uFlags,
270 int x,
271 int y,
272 HWND hWnd,
273 LPTPMPARAMS lptpm);
274
275 BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
276 UINT uReserved,
277 LPCITEMIDLIST *ppidlFolder,
278 LPCITEMIDLIST *ppidlItem);
279
280 LRESULT WINAPI FileMenu_MeasureItem(
281 HWND hWnd,
282 LPMEASUREITEMSTRUCT lpmis);
283
284 LRESULT WINAPI FileMenu_DrawItem(
285 HWND hWnd,
286 LPDRAWITEMSTRUCT lpdis);
287
288 BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
289
290 void WINAPI FileMenu_AbortInitMenu(void);
291
292 LRESULT WINAPI FileMenu_HandleMenuChar(
293 HMENU hMenu,
294 WPARAM wParam);
295
296 BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
297
298 BOOL WINAPI FileMenu_DeleteItemByCmd(
299 HMENU hMenu,
300 UINT uID);
301
302 BOOL WINAPI FileMenu_DeleteItemByIndex(
303 HMENU hMenu,
304 UINT uPos);
305
306 BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
307 HMENU hMenu,
308 UINT uID);
309
310 BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
311
312 BOOL WINAPI FileMenu_EnableItemByCmd(
313 HMENU hMenu,
314 UINT uID,
315 BOOL bEnable);
316
317 DWORD WINAPI FileMenu_GetItemExtent(
318 HMENU hMenu,
319 UINT uPos);
320
321 int WINAPI FileMenu_AppendFilesForPidl(
322 HMENU hMenu,
323 LPCITEMIDLIST pidl,
324 BOOL bAddSeparator);
325
326 int WINAPI FileMenu_AddFilesForPidl(
327 HMENU hMenu,
328 UINT uReserved,
329 UINT uID,
330 LPCITEMIDLIST pidl,
331 UINT uFlags,
332 UINT uEnumFlags,
333 LPFNFMCALLBACK lpfnCallback);
334
335 /****************************************************************************
336 * Drag And Drop Routines
337 */
338
339 HRESULT WINAPI SHRegisterDragDrop(
340 HWND hWnd,
341 LPDROPTARGET lpDropTarget);
342
343 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
344
345 BOOL WINAPI DAD_DragEnter(HWND hWnd);
346
347 BOOL WINAPI DAD_SetDragImageFromListView(
348 HWND hWnd,
349 POINT pt);
350
351 BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
352
353 /****************************************************************************
354 * Path Manipulation Routines
355 */
356
357 BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
358
359 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
360
361 LPVOID WINAPI PathAddBackslashAW(LPVOID path);
362
363 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
364
365 LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
366
367 LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
368
369 LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2);
370
371 LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
372
373 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
374
375 void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
376
377 VOID WINAPI PathQuoteSpacesAW(LPVOID path);
378
379 void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
380
381 BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
382
383 BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
384
385 BOOL WINAPI PathIsRootAW(LPCVOID x);
386
387 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
388
389 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
390
391 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
392
393 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
394
395 BOOL WINAPI PathMakeUniqueNameAW(
396 LPVOID lpszBuffer,
397 DWORD dwBuffSize,
398 LPCVOID lpszShortName,
399 LPCVOID lpszLongName,
400 LPCVOID lpszPathName);
401
402 BOOL WINAPI PathYetAnotherMakeUniqueName(
403 LPWSTR lpszBuffer,
404 LPCWSTR lpszPathName,
405 LPCWSTR lpszShortName,
406 LPCWSTR lpszLongName);
407
408 BOOL WINAPI PathQualifyAW(LPCVOID path);
409
410
411 /* PathResolve flags */
412 #define PRF_CHECKEXISTANCE 0x01
413 #define PRF_EXECUTABLE 0x02
414 #define PRF_QUALIFYONPATH 0x04
415 #define PRF_WINDOWS31 0x08
416
417 BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
418
419 VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
420
421 /* PathProcessCommand flags */
422 #define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */
423 #define PPCF_INCLUDEARGS 0x02
424 //#define PPCF_NODIRECTORIES 0x10 move to shlobj
425 #define PPCF_DONTRESOLVE 0x20
426 #define PPCF_PATHISRELATIVE 0x40
427
428 HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
429 DWORD dwBuffSize, DWORD dwFlags);
430
431 void WINAPI PathStripPathAW(LPVOID lpszPath);
432
433 BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
434
435 void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
436
437 void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
438
439 int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
440
441 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
442
443 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID *sOtherDirs);
444
445 /****************************************************************************
446 * Shell File Operations error codes
447 */
448
449 /* Error codes could be pre-Win32 */
450 #define DE_SAMEFILE 0x71
451 #define DE_MANYSRC1DEST 0x72
452 #define DE_DIFFDIR 0x73
453 #define DE_OPCANCELLED 0x75
454 #define DE_DESTSUBTREE 0x76
455 #define DE_INVALIDFILES 0x7C
456 #define DE_DESTSAMETREE 0x7D
457 #define DE_FLDDESTISFILE 0x7E
458 #define DE_FILEDESTISFLD 0x80
459
460 /****************************************************************************
461 * Shell Namespace Routines
462 */
463
464 /* Generic structure used by several messages */
465 typedef struct
466 {
467 DWORD dwReserved;
468 DWORD dwReserved2;
469 LPCITEMIDLIST pidl;
470 LPDWORD lpdwUser;
471 } SFVCBINFO, * LPSFVCBINFO;
472 typedef const SFVCBINFO * LPCSFVCBINFO;
473
474 /* SFVCB_SELECTIONCHANGED structure */
475 typedef struct
476 {
477 UINT uOldState;
478 UINT uNewState;
479 LPCITEMIDLIST pidl;
480 LPDWORD lpdwUser;
481 } SFVSELECTSTATE, * LPSFVSELECTSTATE;
482 typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
483
484 /* SFVCB_COPYHOOKCALLBACK structure */
485 typedef struct
486 {
487 HWND hwnd;
488 UINT wFunc;
489 UINT wFlags;
490 LPCSTR pszSrcFile;
491 DWORD dwSrcAttribs;
492 LPCSTR pszDestFile;
493 DWORD dwDestAttribs;
494 } SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
495 typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
496
497 /* SFVCB_GETDETAILSOF structure */
498 typedef struct
499 {
500 LPCITEMIDLIST pidl;
501 int fmt;
502 int cx;
503 STRRET lpText;
504 } SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
505
506 /****************************************************************************
507 * Misc Stuff
508 */
509
510 /* SHWaitForFileToOpen flags */
511 #define SHWFF_ADD 0x01
512 #define SHWFF_REMOVE 0x02
513 #define SHWFF_WAIT 0x04
514
515 BOOL WINAPI SHWaitForFileToOpen(
516 LPCITEMIDLIST pidl,
517 DWORD dwFlags,
518 DWORD dwTimeout);
519
520 WORD WINAPI ArrangeWindows(
521 HWND hwndParent,
522 DWORD dwReserved,
523 LPCRECT lpRect,
524 WORD cKids,
525 CONST HWND * lpKids);
526
527 /* RegisterShellHook types */
528 #define RSH_DEREGISTER 0
529 #define RSH_REGISTER 1
530 #define RSH_REGISTER_PROGMAN 2
531 #define RSH_REGISTER_TASKMAN 3
532
533 BOOL WINAPI RegisterShellHook(
534 HWND hWnd,
535 DWORD dwType);
536
537 /* SHCreateDefClassObject callback function */
538 typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
539 LPUNKNOWN pUnkOuter,
540 REFIID riidObject,
541 LPVOID *ppvObject);
542
543 HRESULT WINAPI SHCreateDefClassObject(
544 REFIID riidFactory,
545 LPVOID *ppvFactory,
546 LPFNCDCOCALLBACK lpfnCallback,
547 LPDWORD lpdwUsage,
548 REFIID riidObject);
549
550 void WINAPI SHFreeUnusedLibraries(void);
551
552 /* SHCreateLinks flags */
553 #define SHCLF_PREFIXNAME 0x01
554 #define SHCLF_CREATEONDESKTOP 0x02
555
556 HRESULT WINAPI SHCreateLinks(
557 HWND hWnd,
558 LPCSTR lpszDir,
559 LPDATAOBJECT lpDataObject,
560 UINT uFlags,
561 LPITEMIDLIST *lppidlLinks);
562
563 DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len);
564 DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
565
566 /* policy functions */
567 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
568
569 #define CSIDL_FOLDER_MASK 0x00ff
570
571 /* Utility functions */
572 #include <stdio.h>
573
574 #define SMC_EXEC 4
575 INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc);
576
577 HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv);
578
579 BOOL WINAPI GUIDFromStringW(
580 _In_ PCWSTR psz,
581 _Out_ LPGUID pguid
582 );
583
584 static inline ULONG
585 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
586 {
587 char szMsg[512];
588 char *szMsgStart;
589 const char *fname;
590 va_list vl;
591 ULONG uRet;
592
593 fname = strrchr(filename, '\\');
594 if (fname == NULL)
595 {
596 fname = strrchr(filename, '/');
597 if (fname != NULL)
598 fname++;
599 }
600 else
601 fname++;
602
603 if (fname == NULL)
604 fname = filename;
605
606 szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line);
607
608 va_start(vl, lpFormat);
609 uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl);
610 va_end(vl);
611
612 OutputDebugStringA(szMsg);
613
614 return uRet;
615 }
616
617 #define DbgPrint(fmt, ...) \
618 Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
619
620 static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel)
621 {
622 WCHAR label[128];
623 int i;
624 int count = GetMenuItemCount(hmenu);
625
626 padding[padlevel] = '.';
627 padding[padlevel + 1] = '.';
628 padding[padlevel + 2] = 0;
629
630 for (i = 0; i < count; i++)
631 {
632 MENUITEMINFOW mii = { 0 };
633
634 mii.cbSize = sizeof(mii);
635 mii.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STATE | MIIM_ID;
636 mii.dwTypeData = label;
637 mii.cch = _countof(label);
638
639 GetMenuItemInfoW(hmenu, i, TRUE, &mii);
640
641 if (mii.fType & MFT_BITMAP)
642 DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
643 else if (mii.fType & MFT_SEPARATOR)
644 DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID);
645 else
646 DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE");
647
648 if (mii.hSubMenu)
649 DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2);
650
651 }
652
653 padding[padlevel] = 0;
654 }
655
656 static __inline void DbgDumpMenu(HMENU hmenu)
657 {
658 char padding[128];
659 DbgDumpMenuInternal(hmenu, padding, 0);
660 }
661
662
663 static inline
664 void DumpIdList(LPCITEMIDLIST pcidl)
665 {
666 DbgPrint("Begin IDList Dump\n");
667
668 for (; pcidl != NULL; pcidl = ILGetNext(pcidl))
669 {
670 int i;
671 int cb = pcidl->mkid.cb;
672 BYTE * sh = (BYTE*) &(pcidl->mkid);
673 if (cb == 0) // ITEMIDLISTs are terminatedwith a null SHITEMID.
674 break;
675 DbgPrint("Begin SHITEMID (cb=%d)\n", cb);
676 if ((cb & 3) != 0)
677 DbgPrint(" - WARNING: cb is not a multiple of 4\n");
678 for (i = 0; (i + 4) <= cb; i += 4)
679 {
680 DbgPrint(" - abID[%08x]: %02x %02x %02x %02x\n",
681 i,
682 sh[i + 0],
683 sh[i + 1],
684 sh[i + 2],
685 sh[i + 3]);
686 }
687 if (i < cb)
688 {
689 cb -= i;
690 if (cb == 3)
691 {
692 DbgPrint(" - abID[%08x]: %02x %02x %02x --\n",
693 i,
694 sh[i + 0],
695 sh[i + 1],
696 sh[i + 2]);
697 }
698 else if (cb == 2)
699 {
700 DbgPrint(" - abID[%08x]: %02x %02x -- --\n",
701 i,
702 sh[i + 0],
703 sh[i + 1]);
704 }
705 else if (cb == 1)
706 {
707 DbgPrint(" - abID[%08x]: %02x -- -- --\n",
708 i,
709 sh[i + 0]);
710 }
711 }
712 DbgPrint("End SHITEMID\n");
713 }
714 DbgPrint("End IDList Dump.\n");
715 }
716
717
718 /*****************************************************************************
719 * Shell32 resources
720 */
721 // these resources are in shell32.dll
722 #define IDB_GOBUTTON_NORMAL 0x0e6
723 #define IDB_GOBUTTON_HOT 0x0e7
724
725 // band ids in internet toolbar
726 #define ITBBID_MENUBAND 1
727 #define ITBBID_BRANDBAND 5
728 #define ITBBID_TOOLSBAND 2
729 #define ITBBID_ADDRESSBAND 4
730
731 // commands in the CGID_PrivCITCommands command group handled by the internet toolbar
732 // there seems to be some support for hiding the menubar and an auto hide feature that are
733 // unavailable in the UI
734 #define ITID_TEXTLABELS 3
735 #define ITID_TOOLBARBANDSHOWN 4
736 #define ITID_ADDRESSBANDSHOWN 5
737 #define ITID_LINKSBANDSHOWN 6
738 #define ITID_MENUBANDSHOWN 12
739 #define ITID_AUTOHIDEENABLED 13
740 #define ITID_CUSTOMIZEENABLED 20
741 #define ITID_TOOLBARLOCKED 27
742
743 // commands in the CGID_BrandCmdGroup command group handled by the brand band
744 #define BBID_STARTANIMATION 1
745 #define BBID_STOPANIMATION 2
746
747 // undocumented flags for IShellMenu::SetShellFolder
748 #define SMSET_UNKNOWN08 0x08
749 #define SMSET_UNKNOWN10 0x10
750
751 void WINAPI ShellDDEInit(BOOL bInit);
752 DWORD WINAPI WinList_Init(void);
753
754 IStream* WINAPI SHGetViewStream(LPCITEMIDLIST, DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
755
756 EXTERN_C HRESULT WINAPI SHCreateSessionKey(REGSAM samDesired, PHKEY phKey);
757
758 /*****************************************************************************
759 * Shell Link
760 */
761 #include <pshpack1.h>
762
763 typedef struct tagSHELL_LINK_HEADER
764 {
765 /* The size of this structure (always 0x0000004C) */
766 DWORD dwSize;
767 /* CLSID = class identifier (always 00021401-0000-0000-C000-000000000046) */
768 CLSID clsid;
769 /* Flags (SHELL_LINK_DATA_FLAGS) */
770 DWORD dwFlags;
771 /* Informations about the link target: */
772 DWORD dwFileAttributes;
773 FILETIME ftCreationTime;
774 FILETIME ftLastAccessTime;
775 FILETIME ftLastWriteTime;
776 DWORD nFileSizeLow; /* only the least significant 32 bits */
777 /* The index of an icon (signed?) */
778 DWORD nIconIndex;
779 /* The expected window state of an application launched by the link */
780 DWORD nShowCommand;
781 /* The keystrokes used to launch the application */
782 WORD wHotKey;
783 /* Reserved (must be zero) */
784 WORD wReserved1;
785 DWORD dwReserved2;
786 DWORD dwReserved3;
787 } SHELL_LINK_HEADER, *LPSHELL_LINK_HEADER;
788
789 /*****************************************************************************
790 * SHELL_LINK_INFOA/W
791 * If cbHeaderSize == 0x0000001C then use SHELL_LINK_INFOA
792 * If cbHeaderSize >= 0x00000024 then use SHELL_LINK_INFOW
793 */
794 typedef struct tagSHELL_LINK_INFOA
795 {
796 /* Size of the link info data */
797 DWORD cbSize;
798 /* Size of this structure (ANSI: = 0x0000001C) */
799 DWORD cbHeaderSize;
800 /* Specifies which fields are present/populated (SLI_*) */
801 DWORD dwFlags;
802 /* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
803 DWORD cbVolumeIDOffset;
804 /* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
805 DWORD cbLocalBasePathOffset;
806 /* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
807 DWORD cbCommonNetworkRelativeLinkOffset;
808 /* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
809 DWORD cbCommonPathSuffixOffset;
810 } SHELL_LINK_INFOA, *LPSHELL_LINK_INFOA;
811
812 typedef struct tagSHELL_LINK_INFOW
813 {
814 /* Size of the link info data */
815 DWORD cbSize;
816 /* Size of this structure (Unicode: >= 0x00000024) */
817 DWORD cbHeaderSize;
818 /* Specifies which fields are present/populated (SLI_*) */
819 DWORD dwFlags;
820 /* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
821 DWORD cbVolumeIDOffset;
822 /* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
823 DWORD cbLocalBasePathOffset;
824 /* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
825 DWORD cbCommonNetworkRelativeLinkOffset;
826 /* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
827 DWORD cbCommonPathSuffixOffset;
828 /* Offset of the LocalBasePathUnicode field (Unicode, NULL-terminated string) */
829 DWORD cbLocalBasePathUnicodeOffset;
830 /* Offset of the CommonPathSuffixUnicode field (Unicode, NULL-terminated string) */
831 DWORD cbCommonPathSuffixUnicodeOffset;
832 } SHELL_LINK_INFOW, *LPSHELL_LINK_INFOW;
833
834 /* VolumeID, LocalBasePath, LocalBasePathUnicode(cbHeaderSize >= 0x24) are present */
835 #define SLI_VALID_LOCAL 0x00000001
836 /* CommonNetworkRelativeLink is present */
837 #define SLI_VALID_NETWORK 0x00000002
838
839 /*****************************************************************************
840 * SHELL_LINK_INFO_VOLUME_IDA/W
841 * If cbVolumeLabelOffset != 0x00000014 (should be 0x00000010) then use
842 * SHELL_LINK_INFO_VOLUME_IDA
843 * If cbVolumeLabelOffset == 0x00000014 then use SHELL_LINK_INFO_VOLUME_IDW
844 */
845 typedef struct tagSHELL_LINK_INFO_VOLUME_IDA
846 {
847 /* Size of the VolumeID field (> 0x00000010) */
848 DWORD cbSize;
849 /* Drive type of the drive the link target is stored on (DRIVE_*) */
850 DWORD dwDriveType;
851 /* Serial number of the volume the link target is stored on */
852 DWORD nDriveSerialNumber;
853 /* Offset of the volume label (ANSI, NULL-terminated string).
854 Must be != 0x00000014 (see tagSHELL_LINK_INFO_VOLUME_IDW) */
855 DWORD cbVolumeLabelOffset;
856 } SHELL_LINK_INFO_VOLUME_IDA, *LPSHELL_LINK_INFO_VOLUME_IDA;
857
858 typedef struct tagSHELL_LINK_INFO_VOLUME_IDW
859 {
860 /* Size of the VolumeID field (> 0x00000010) */
861 DWORD cbSize;
862 /* Drive type of the drive the link target is stored on (DRIVE_*) */
863 DWORD dwDriveType;
864 /* Serial number of the volume the link target is stored on */
865 DWORD nDriveSerialNumber;
866 /* Offset of the volume label (ANSI, NULL-terminated string).
867 If the value of this field is 0x00000014, ignore it and use
868 cbVolumeLabelUnicodeOffset! */
869 DWORD cbVolumeLabelOffset;
870 /* Offset of the volume label (Unicode, NULL-terminated string).
871 If the value of the VolumeLabelOffset field is not 0x00000014,
872 this field must be ignored (==> it doesn't exists ==> ANSI). */
873 DWORD cbVolumeLabelUnicodeOffset;
874 } SHELL_LINK_INFO_VOLUME_IDW, *LPSHELL_LINK_INFO_VOLUME_IDW;
875
876 /*****************************************************************************
877 * SHELL_LINK_INFO_CNR_LINKA/W (CNR = Common Network Relative)
878 * If cbNetNameOffset == 0x00000014 then use SHELL_LINK_INFO_CNR_LINKA
879 * If cbNetNameOffset > 0x00000014 then use SHELL_LINK_INFO_CNR_LINKW
880 */
881 typedef struct tagSHELL_LINK_INFO_CNR_LINKA
882 {
883 /* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
884 DWORD cbSize;
885 /* Specifies which fields are present/populated (SLI_CNR_*) */
886 DWORD dwFlags;
887 /* Offset of the NetName field (ANSI, NULL–terminated string) */
888 DWORD cbNetNameOffset;
889 /* Offset of the DeviceName field (ANSI, NULL–terminated string) */
890 DWORD cbDeviceNameOffset;
891 /* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
892 DWORD dwNetworkProviderType;
893 } SHELL_LINK_INFO_CNR_LINKA, *LPSHELL_LINK_INFO_CNR_LINKA;
894
895 typedef struct tagSHELL_LINK_INFO_CNR_LINKW
896 {
897 /* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
898 DWORD cbSize;
899 /* Specifies which fields are present/populated (SLI_CNR_*) */
900 DWORD dwFlags;
901 /* Offset of the NetName field (ANSI, NULL–terminated string) */
902 DWORD cbNetNameOffset;
903 /* Offset of the DeviceName field (ANSI, NULL–terminated string) */
904 DWORD cbDeviceNameOffset;
905 /* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
906 DWORD dwNetworkProviderType;
907 /* Offset of the NetNameUnicode field (Unicode, NULL–terminated string) */
908 DWORD cbNetNameUnicodeOffset;
909 /* Offset of the DeviceNameUnicode field (Unicode, NULL–terminated string) */
910 DWORD cbDeviceNameUnicodeOffset;
911 } SHELL_LINK_INFO_CNR_LINKW, *LPSHELL_LINK_INFO_CNR_LINKW;
912
913 /* DeviceName is present */
914 #define SLI_CNR_VALID_DEVICE 0x00000001
915 /* NetworkProviderType is present */
916 #define SLI_CNR_VALID_NET_TYPE 0x00000002
917
918 /*****************************************************************************
919 * Shell Link Extra Data (IShellLinkDataList)
920 */
921 typedef struct tagEXP_TRACKER
922 {
923 /* .cbSize = 0x00000060, .dwSignature = 0xa0000003 */
924 DATABLOCK_HEADER dbh;
925 /* Length >= 0x00000058 */
926 DWORD nLength;
927 /* Must be 0x00000000 */
928 DWORD nVersion;
929 /* NetBIOS name (ANSI, unused bytes are set to zero) */
930 CHAR szMachineID[16]; /* "variable" >= 16 (?) */
931 /* Some GUIDs for the Link Tracking service (from the FS?) */
932 GUID guidDroidVolume;
933 GUID guidDroidObject;
934 GUID guidDroidBirthVolume;
935 GUID guidDroidBirthObject;
936 } EXP_TRACKER, *LPEXP_TRACKER;
937
938 typedef struct tagEXP_SHIM
939 {
940 /* .cbSize >= 0x00000088, .dwSignature = 0xa0000008 */
941 DATABLOCK_HEADER dbh;
942 /* Name of a shim layer to apply (Unicode, unused bytes are set to zero) */
943 WCHAR szwLayerName[64]; /* "variable" >= 64 */
944 } EXP_SHIM, *LPEXP_SHIM;
945
946 typedef struct tagEXP_KNOWN_FOLDER
947 {
948 /* .cbSize = 0x0000001c, .dwSignature = 0xa000000b */
949 DATABLOCK_HEADER dbh;
950 /* A GUID value that identifies a known folder */
951 GUID guidKnownFolder;
952 /* Specifies the location of the ItemID of the first child
953 segment of the IDList specified by guidKnownFolder */
954 DWORD cbOffset;
955 } EXP_KNOWN_FOLDER, *LPEXP_KNOWN_FOLDER;
956
957 typedef struct tagEXP_VISTA_ID_LIST
958 {
959 /* .cbSize >= 0x0000000a, .dwSignature = 0xa000000c */
960 DATABLOCK_HEADER dbh;
961 /* Specifies an alternate IDList that can be used instead
962 of the "normal" IDList (SLDF_HAS_ID_LIST) */
963 /* LPITEMIDLIST pIDList; (variable) */
964 } EXP_VISTA_ID_LIST, *LPEXP_VISTA_ID_LIST;
965
966 #define EXP_TRACKER_SIG 0xa0000003
967 #define EXP_SHIM_SIG 0xa0000008
968 #define EXP_KNOWN_FOLDER_SIG 0xa000000b
969 #define EXP_VISTA_ID_LIST_SIG 0xa000000c
970
971 #include <poppack.h>
972
973 #ifdef __cplusplus
974 } /* extern "C" */
975 #endif /* defined(__cplusplus) */
976
977 #endif /* __WINE_UNDOCSHELL_H */