110#pragma comment(linker, \
111 "\"/manifestdependency:type='Win32' "\
112 "name='Microsoft.Windows.Common-Controls' "\
113 "version='6.0.0.0' "\
114 "processorArchitecture='*' "\
115 "publicKeyToken='6595b64144ccf1df' "\
139 while (curIndex < menuItemCount)
141 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
144 menuItemInfo.
wID >= firstIDToDelete && menuItemInfo.
wID <= lastIDToDelete)
163 *newFolder = desktop;
164 desktop.
p->AddRef ();
177 public CWindowImpl<CToolbarProxy, CWindow, CControlWinTraits>
202 if (myWindow !=
NULL)
256 public CWindowImpl<CShellBrowser, CWindow, CFrameWinTraits>,
262 public IShellBrowserService,
266 public IDockingWindowSite,
420 DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
override;
792 hResult =
SUCCEEDED(hResult) ? persistStreamInit->Load(pITBarStream) : persistStreamInit->InitNew();
808 _AtlBaseModule.GetModuleInstance(), 0);
842 if ((
Flags & (SBSP_SAMEBROWSER | SBSP_NEWBROWSER)) == SBSP_DEFBROWSER)
845 Flags |= SBSP_SAMEBROWSER;
849 if (
Flags & (SBSP_NAVIGATEBACK | SBSP_NAVIGATEFORWARD))
850 Flags = (
Flags & ~SBSP_NEWBROWSER) | SBSP_SAMEBROWSER;
859 if ((SbspFlags & (SBSP_OPENMODE | SBSP_EXPLOREMODE)) == SBSP_DEFMODE)
871 if (SbspFlags & SBSP_RELATIVE)
874 if (SbspFlags & SBSP_PARENT)
892 BOOL HasIconViewType;
901 HasIconViewType =
clsid == CLSID_MyComputer ||
clsid == CLSID_ControlPanel ||
902 clsid == CLSID_ShellDesktop;
924 reinterpret_cast<const BYTE *
>(pidl) +
length);
925 if (pidlnext->mkid.cb != 0)
943 if (ppidlLast !=
NULL)
947 if (ppidlLast !=
NULL)
958 hResult = psf->BindToObject(pidlParent,
NULL, *
riid,
ppv);
960 *ppidlLast = pidlChild;
980 hResult = parentFolder->GetDisplayNameOf(childPIDL,
uFlags, &L108);
987 hResult = parentFolder->GetAttributesOf(1,
const_cast<LPCITEMIDLIST *
>(&childPIDL), rgfInOut);
1019 HWND newShellViewWindow;
1020 BOOL windowUpdateIsLocked;
1021 RECT shellViewWindowBounds;
1032 if (newShellFolder ==
NULL)
1046 if (travelLog->CountEntries(
static_cast<IDropTarget *
>(
this)) > 0)
1079 if (previousView !=
NULL)
1082 ZeroMemory(&shellViewWindowBounds,
sizeof(shellViewWindowBounds));
1097 hResult = newShellView->CreateViewWindow(saveCurrentShellView, folderSettings,
1098 this, &shellViewWindowBounds, &newShellViewWindow);
1104 if (windowUpdateIsLocked)
1111 if (saveCurrentShellView !=
NULL)
1112 saveCurrentShellView->DestroyViewWindow();
1115 if (previousView ==
NULL)
1121 saveCurrentShellView.
Release();
1122 saveCurrentShellFolder.
Release();
1127 if (windowUpdateIsLocked)
1139 nameFlags = SHGDN_FORADDRESSBAR | SHGDN_FORPARSING;
1141 sizeof(newTitle) /
sizeof(
wchar_t),
NULL);
1199 hResult = bandSite->QueryBand(1, &deskBand,
NULL,
NULL, 0);
1203 return deskBand->QueryInterface(
riid, shellMenu);
1229 *
cache = newBaseBar;
1241 hResult = deskBar->SetClient(newBaseBarSite);
1246 hResult = newBaseBarSite->QueryInterface(
IID_PPV_ARG(IDeskBarClient, &deskBarClient));
1249 hResult = deskBarClient->SetDeskBarSite(newBaseBar);
1272 hResult = deskBar->GetClient(&baseBarSite);
1279 hResult = bandSite->EnumBands(-1, &numBands);
1283 for(
i = 0;
i < numBands;
i++)
1287 hResult = bandSite->EnumBands(
i, &dwBandID);
1294 hResult = bandPersist->GetClassID(&clsidTmp);
1299 if (pdwBandID) *pdwBandID = dwBandID;
1320 hResult = deskBar->GetClient(&baseBarSite);
1333 TRACE(
"CLSID_ExplorerBand requested, building internal band.\n");
1340 TRACE(
"CLSID_FileSearchBand requested, building internal band.\n");
1347 TRACE(
"A different CLSID requested, using CoCreateInstance.\n");
1360 ERR(
"Can't get IBandSite interface\n");
1366 ERR(
"Can't find band object\n");
1382 hResult = dockingWindow->ShowDW(
TRUE);
1398 if (newDirectory ==
NULL)
1418 sheetInfo->phpage[sheetInfo->nPages] = thePage;
1419 sheetInfo->nPages++;
1432 memset(m_psp, 0,
sizeof(m_psp));
1433 memset(&m_PropSheet, 0,
sizeof(m_PropSheet));
1443 m_PropSheet.phpage = m_psp;
1449 hResult = globalSettings->Get(&shellState,
sizeof(shellState));
1470 m_PropSheet.dwFlags = 0;
1471 m_PropSheet.hwndParent =
m_hWnd;
1472 m_PropSheet.hInstance = _AtlBaseModule.GetResourceInstance();
1473 m_PropSheet.pszCaption = strFolderOptions;
1474 m_PropSheet.nStartPage = 0;
1500 hResult = menuBand->TranslateMenuMessage(&
msg, &lResult);
1501 if (hResult ==
S_OK)
1512 if (handled ==
FALSE)
1528 pThis->
m_dwState &= ~WINSTATE_DESTROYED;
1552 for (
x = 0;
x < 3;
x++)
1563 RECT toolbarRect = clientRect;
1564 if (borderSpace.
top != 0)
1566 toolbarRect.
bottom = toolbarRect.
top + borderSpace.
top;
1568 else if (borderSpace.
bottom != 0)
1572 else if (borderSpace.
left != 0)
1576 else if (borderSpace.
right != 0)
1588 if (borderSpace.
top != 0)
1592 else if (borderSpace.
bottom != 0)
1596 else if (borderSpace.
left != 0)
1600 else if (borderSpace.
right != 0)
1618 params.rgvarg = arguments;
1623 while (pp <
vec.end())
1635 while (pp < vec2.
end())
1673 V_BOOL(&varArg[0]) = newState ? VARIANT_TRUE : VARIANT_FALSE;
1675 V_I4(&varArg[1]) = commandID;
1694 canGoForward =
false;
1698 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
TLOG_BACK, &unusedEntry);
1704 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
TLOG_FORE, &unusedEntry);
1707 canGoForward =
true;
1742 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
1754 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
1770 hResult = travelLog->InsertMenuEntries(
static_cast<IDropTarget *
>(
this), theMenu, position,
1774 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
1787 HMENU toolbarMenuBar;
1793 if (gotoMenu !=
NULL)
1803 CGID_PrivCITCommands, 5, commandList,
NULL);
1808 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
1833 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
1835 menuItemInfo.
hSubMenu = toolbarMenu;
1900 pEnumGUID->Next(1, &iter, &dwRead);
1945 CMINVOKECOMMANDINFO commandInfo;
1946 const char *searchGUID =
"{169A0691-8DF9-11d1-A1C4-00C04FD75D13}";
1951 memset(&commandInfo, 0,
sizeof(commandInfo));
1952 commandInfo.cbSize =
sizeof(commandInfo);
1953 commandInfo.hwnd =
m_hWnd;
1954 commandInfo.lpParameters = searchGUID;
1964 hResult = objectWithSite->SetSite(
dynamic_cast<IShellBrowser*
>(
this));
1967 hResult = contextMenu->InvokeCommand(&commandInfo);
1968 hResult = objectWithSite->SetSite(
NULL);
1988 if (int1Retry == int2Retry)
1997 RECT availableBounds;
2000 for (
INT x = 0;
x < 3;
x++)
2010 *prcBorder = availableBounds;
2021 for (
INT x = 0;
x < 3;
x++)
2040 if (prgCmds ==
NULL)
2042 if (pguidCmdGroup ==
NULL)
2048 return commandTarget->QueryStatus(
NULL, 1, prgCmds, pCmdText);
2057 else if (
IsEqualIID(*pguidCmdGroup, CGID_Explorer))
2061 switch (prgCmds->
cmdID)
2096 else if (
IsEqualIID(*pguidCmdGroup, CGID_ShellBrowser))
2100 switch (prgCmds->
cmdID)
2122 TRACE(
"Unhandled null CGID %d %d %p %p\n", nCmdID, nCmdexecopt, pvaIn, pvaOut);
2125 if (
IsEqualIID(*pguidCmdGroup, CGID_Explorer))
2134 if (nCmdID == 0x1c) pclsid = &CLSID_FileSearchBand;
2135 else if (nCmdID == 0x1d) pclsid = &CLSID_SH_HistBand;
2136 else if (nCmdID == 0x1e) pclsid = &CLSID_SH_FavBand;
2137 else pclsid = &CLSID_ExplorerBand;
2162 if (nCmdexecopt == 1)
2192 else if (
IsEqualIID(*pguidCmdGroup, CGID_Theater))
2210 else if (
IsEqualIID(*pguidCmdGroup, CGID_ShellDocView))
2225 else if (
IsEqualIID(*pguidCmdGroup, CGID_ShellBrowser))
2244 else if (
IsEqualIID(*pguidCmdGroup, CGID_DefView))
2285 lpMenuWidths->width[0] = 2;
2286 lpMenuWidths->width[2] = 3;
2287 lpMenuWidths->width[4] = 1;
2313 hResult = shellMenu->SetMenu(hmenuShared,
m_hWnd, SMSET_DONTOWN);
2361 if ((
wFlags & SBSP_EXPLOREMODE) && !(
wFlags & SBSP_NEWBROWSER))
2362 ShowBand(CLSID_ExplorerBand,
true);
2365 if (
wFlags & (SBSP_RELATIVE | SBSP_PARENT))
2370 pidl = pidlResolved;
2373 if (
wFlags & SBSP_NEWBROWSER)
2376 switch (
wFlags & (SBSP_ABSOLUTE | SBSP_RELATIVE | SBSP_PARENT | SBSP_NAVIGATEBACK | SBSP_NAVIGATEFORWARD))
2380 case SBSP_NAVIGATEBACK:
2382 case SBSP_NAVIGATEFORWARD:
2390 if (
wFlags & SBSP_ACTIVATE_NOFOCUS)
2499 if (
IsEqualIID(guidService, SID_STopLevelBrowser))
2507 if (
IsEqualIID(guidService, SID_SProxyBrowser))
2537 flags |= SHGVSPB_ROAM;
2612 else if (!shown == !fShow)
2663 CGID_PrivCITCommands, 1, &
cmd,
NULL);
2968 const UINT navflags = HLNF_NAVIGATINGBACK | HLNF_NAVIGATINGFORWARD;
2969 if ((grfHLNF & navflags) && grfHLNF != ~0ul)
2971 UINT SbspFlags = (grfHLNF & HLNF_NAVIGATINGBACK) ? SBSP_NAVIGATEBACK : SBSP_NAVIGATEFORWARD;
2972 if (grfHLNF & SHHLNF_WRITENOHISTORY)
2973 SbspFlags |= SBSP_WRITENOHISTORY;
2974 if (grfHLNF & SHHLNF_NOAUTOSELECT)
2975 SbspFlags |= SBSP_NOAUTOSELECT;
3121 for (
int i = 0;
i < 3;
i++)
3448 return ShowBand(classID, vertical);
3533 if (pWinData ==
NULL)
3564 hResult = pStream->
Read(&oldState,
sizeof(oldState), &numRead);
3567 if (numRead !=
sizeof(oldState) || oldState.
dwSize !=
sizeof(oldState))
3574 hResult = pStream->
Read(pidl, oldState.
pidlSize, &numRead);
3608 memset(&newState, 0,
sizeof(newState));
3609 newState.
dwSize =
sizeof(newState);
3612 if (viewPersistHistory.
p !=
NULL)
3614 hResult = viewPersistHistory->GetClassID(&newState.
persistClass);
3619 hResult = pStream->
Write(&newState,
sizeof(newState),
NULL);
3625 if (viewPersistHistory.
p !=
NULL)
3627 hResult = viewPersistHistory->SaveHistory(pStream);
3665 for (
int i = 0;
i < 3;
i++)
3683 hr =
bar->GetClient(&pBarSite);
3686 hr = pBarSite->QueryInterface(
IID_PPV_ARG(IDeskBarClient, &pClient));
3688 pClient->SetDeskBarSite(
NULL);
3714 RECT availableBounds;
3721 for (
INT x = 0;
x < 3;
x++)
3729 hResult = dockingWindow->ResizeBorderDW(