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' "\
138 while (curIndex < menuItemCount)
140 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
143 menuItemInfo.
wID >= firstIDToDelete && menuItemInfo.
wID <= lastIDToDelete)
162 *newFolder = desktop;
163 desktop.
p->AddRef ();
176 public CWindowImpl<CToolbarProxy, CWindow, CControlWinTraits>
201 if (myWindow !=
NULL)
255 public CWindowImpl<CShellBrowser, CWindow, CFrameWinTraits>,
261 public IShellBrowserService,
265 public IDockingWindowSite,
408 DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr);
775 hResult = persistStreamInit->InitNew();
790 _AtlBaseModule.GetModuleInstance(), 0);
813 newFolderSettings.
fFlags = 0;
832 reinterpret_cast<const BYTE *
>(pidl) +
length);
833 if (pidlnext->mkid.cb != 0)
851 if (ppidlLast !=
NULL)
855 if (ppidlLast !=
NULL)
866 hResult = psf->BindToObject(pidlParent,
NULL, *
riid,
ppv);
868 *ppidlLast = pidlChild;
888 hResult = parentFolder->GetDisplayNameOf(childPIDL,
uFlags, &L108);
895 hResult = parentFolder->GetAttributesOf(1,
const_cast<LPCITEMIDLIST *
>(&childPIDL), rgfInOut);
920 HWND newShellViewWindow;
921 BOOL windowUpdateIsLocked;
922 RECT shellViewWindowBounds;
929 if (newShellFolder ==
NULL)
939 if (travelLog->CountEntries(
static_cast<IDropTarget *
>(
this)) > 0)
971 if (previousView !=
NULL)
974 ZeroMemory(&shellViewWindowBounds,
sizeof(shellViewWindowBounds));
982 hResult = newShellView->CreateViewWindow(saveCurrentShellView, folderSettings,
983 this, &shellViewWindowBounds, &newShellViewWindow);
989 if (windowUpdateIsLocked)
996 if (saveCurrentShellView !=
NULL)
997 saveCurrentShellView->DestroyViewWindow();
1000 if (previousView ==
NULL)
1006 saveCurrentShellView.
Release();
1007 saveCurrentShellFolder.
Release();
1009 hResult = newShellView->UIActivate(SVUIA_ACTIVATE_FOCUS);
1012 if (windowUpdateIsLocked)
1024 nameFlags = SHGDN_FORADDRESSBAR | SHGDN_FORPARSING;
1026 sizeof(newTitle) /
sizeof(
wchar_t),
NULL);
1037 nameFlags = SHGDN_FORADDRESSBAR | SHGDN_FORPARSING;
1039 nameFlags = SHGDN_FORADDRESSBAR;
1041 sizeof(newTitle) /
sizeof(
wchar_t),
NULL);
1093 hResult = bandSite->QueryBand(1, &deskBand,
NULL,
NULL, 0);
1097 return deskBand->QueryInterface(
riid, shellMenu);
1123 *
cache = newBaseBar;
1135 hResult = deskBar->SetClient(newBaseBarSite);
1140 hResult = newBaseBarSite->QueryInterface(
IID_PPV_ARG(IDeskBarClient, &deskBarClient));
1143 hResult = deskBarClient->SetDeskBarSite(newBaseBar);
1166 hResult = deskBar->GetClient(&baseBarSite);
1173 hResult = bandSite->EnumBands(-1, &numBands);
1177 for(
i = 0;
i < numBands;
i++)
1181 hResult = bandSite->EnumBands(
i, &dwBandID);
1188 hResult = bandPersist->GetClassID(&clsidTmp);
1193 if (pdwBandID) *pdwBandID = dwBandID;
1214 hResult = deskBar->GetClient(&baseBarSite);
1227 TRACE(
"CLSID_ExplorerBand requested, building internal band.\n");
1234 TRACE(
"CLSID_FileSearchBand requested, building internal band.\n");
1241 TRACE(
"A different CLSID requested, using CoCreateInstance.\n");
1254 ERR(
"Can't get IBandSite interface\n");
1260 ERR(
"Can't find band object\n");
1276 hResult = dockingWindow->ShowDW(
TRUE);
1292 if (newDirectory ==
NULL)
1312 sheetInfo->phpage[sheetInfo->nPages] = thePage;
1313 sheetInfo->nPages++;
1326 memset(m_psp, 0,
sizeof(m_psp));
1327 memset(&m_PropSheet, 0,
sizeof(m_PropSheet));
1337 m_PropSheet.phpage = m_psp;
1343 hResult = globalSettings->Get(&shellState,
sizeof(shellState));
1368 m_PropSheet.dwFlags = 0;
1369 m_PropSheet.hwndParent =
m_hWnd;
1370 m_PropSheet.hInstance = _AtlBaseModule.GetResourceInstance();
1371 m_PropSheet.pszCaption = strFolderOptions;
1372 m_PropSheet.nStartPage = 0;
1398 hResult = menuBand->TranslateMenuMessage(&
msg, &lResult);
1399 if (hResult ==
S_OK)
1410 if (handled ==
FALSE)
1426 pThis->
m_dwState &= ~WINSTATE_DESTROYED;
1450 for (
x = 0;
x < 3;
x++)
1461 RECT toolbarRect = clientRect;
1462 if (borderSpace.
top != 0)
1464 toolbarRect.
bottom = toolbarRect.
top + borderSpace.
top;
1466 else if (borderSpace.
bottom != 0)
1470 else if (borderSpace.
left != 0)
1474 else if (borderSpace.
right != 0)
1486 if (borderSpace.
top != 0)
1490 else if (borderSpace.
bottom != 0)
1494 else if (borderSpace.
left != 0)
1498 else if (borderSpace.
right != 0)
1516 params.rgvarg = arguments;
1521 while (pp <
vec.end())
1533 while (pp < vec2.
end())
1571 V_BOOL(&varArg[0]) = newState ? VARIANT_TRUE : VARIANT_FALSE;
1573 V_I4(&varArg[1]) = commandID;
1592 canGoForward =
false;
1596 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
TLOG_BACK, &unusedEntry);
1602 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
TLOG_FORE, &unusedEntry);
1605 canGoForward =
true;
1640 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
1652 hResult = travelLog->GetTravelEntry(
static_cast<IDropTarget *
>(
this),
1668 hResult = travelLog->InsertMenuEntries(
static_cast<IDropTarget *
>(
this), theMenu, position,
1672 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
1685 HMENU toolbarMenuBar;
1691 if (gotoMenu !=
NULL)
1701 CGID_PrivCITCommands, 5, commandList,
NULL);
1706 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
1731 menuItemInfo.
cbSize =
sizeof(menuItemInfo);
1733 menuItemInfo.
hSubMenu = toolbarMenu;
1785 pEnumGUID->Next(1, &iter, &dwRead);
1830 CMINVOKECOMMANDINFO commandInfo;
1831 const char *searchGUID =
"{169A0691-8DF9-11d1-A1C4-00C04FD75D13}";
1836 memset(&commandInfo, 0,
sizeof(commandInfo));
1837 commandInfo.cbSize =
sizeof(commandInfo);
1838 commandInfo.hwnd =
m_hWnd;
1839 commandInfo.lpParameters = searchGUID;
1849 hResult = objectWithSite->SetSite(
dynamic_cast<IShellBrowser*
>(
this));
1852 hResult = contextMenu->InvokeCommand(&commandInfo);
1853 hResult = objectWithSite->SetSite(
NULL);
1873 if (int1Retry == int2Retry)
1880 static const INT excludeItems[] = { 1, 1, 1, 0xa001, 0, 0 };
1882 RECT availableBounds;
1885 for (
INT x = 0;
x < 3;
x++)
1895 *prcBorder = availableBounds;
1906 for (
INT x = 0;
x < 3;
x++)
1925 if (prgCmds ==
NULL)
1927 if (pguidCmdGroup ==
NULL)
1933 return commandTarget->QueryStatus(
NULL, 1, prgCmds, pCmdText);
1942 else if (
IsEqualIID(*pguidCmdGroup, CGID_Explorer))
1946 switch (prgCmds->
cmdID)
1981 else if (
IsEqualIID(*pguidCmdGroup, CGID_ShellBrowser))
1985 switch (prgCmds->
cmdID)
2007 TRACE(
"Unhandled null CGID %d %d %p %p\n", nCmdID, nCmdexecopt, pvaIn, pvaOut);
2010 if (
IsEqualIID(*pguidCmdGroup, CGID_Explorer))
2019 if (nCmdID == 0x1c) pclsid = &CLSID_FileSearchBand;
2020 else if (nCmdID == 0x1d) pclsid = &CLSID_SH_HistBand;
2021 else if (nCmdID == 0x1e) pclsid = &CLSID_SH_FavBand;
2022 else pclsid = &CLSID_ExplorerBand;
2047 if (nCmdexecopt == 1)
2077 else if (
IsEqualIID(*pguidCmdGroup, CGID_Theater))
2095 else if (
IsEqualIID(*pguidCmdGroup, CGID_ShellDocView))
2110 else if (
IsEqualIID(*pguidCmdGroup, CGID_ShellBrowser))
2126 else if (
IsEqualIID(*pguidCmdGroup, CGID_DefView))
2166 lpMenuWidths->width[0] = 2;
2167 lpMenuWidths->width[2] = 3;
2168 lpMenuWidths->width[4] = 1;
2194 hResult = shellMenu->SetMenu(hmenuShared,
m_hWnd, SMSET_DONTOWN);
2241 ShowBand(CLSID_ExplorerBand,
true);
2347 if (
IsEqualIID(guidService, SID_STopLevelBrowser))
2355 if (
IsEqualIID(guidService, SID_SProxyBrowser))
2882 for (
int i = 0;
i < 3;
i++)
3209 return ShowBand(classID, vertical);
3294 if (pWinData ==
NULL)
3325 hResult = pStream->
Read(&oldState,
sizeof(oldState), &numRead);
3328 if (numRead !=
sizeof(oldState) || oldState.
dwSize !=
sizeof(oldState))
3335 hResult = pStream->
Read(pidl, oldState.
pidlSize, &numRead);
3369 memset(&newState, 0,
sizeof(newState));
3370 newState.
dwSize =
sizeof(newState);
3373 if (viewPersistHistory.
p !=
NULL)
3375 hResult = viewPersistHistory->GetClassID(&newState.
persistClass);
3380 hResult = pStream->
Write(&newState,
sizeof(newState),
NULL);
3386 if (viewPersistHistory.
p !=
NULL)
3388 hResult = viewPersistHistory->SaveHistory(pStream);
3425 for (
int i = 0;
i < 3;
i++)
3443 hr =
bar->GetClient(&pBarSite);
3446 hr = pBarSite->QueryInterface(
IID_PPV_ARG(IDeskBarClient, &pClient));
3448 pClient->SetDeskBarSite(
NULL);
3474 RECT availableBounds;
3475 static const INT excludeItems[] = {1, 1, 1, 0xa001, 0, 0};
3481 for (
INT x = 0;
x < 3;
x++)
3489 hResult = dockingWindow->ResizeBorderDW(
3569 TRACE(
"DoFolderOptions failed with hResult=%08lx\n", hResult);
3597 TRACE(
"GoBack failed with hResult=%08lx\n", hResult);
3605 TRACE(
"GoForward failed with hResult=%08lx\n", hResult);
3613 TRACE(
"NavigateToParent failed with hResult=%08lx\n", hResult);
3621 TRACE(
"GoHome failed with hResult=%08lx\n", hResult);
3630 TRACE(
"NavigateToParent failed with hResult=%08lx\n", hResult);
3745 ShowBand(CLSID_FileSearchBand,
true);
3748 ShowBand(CLSID_ExplorerBand,
true);