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