mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 00:45:43 +00:00
[BROWSEUI] CShellBrowser: Don't pass any parameters to Initialize. Let users use the BrowseObject method instead.
This commit is contained in:
parent
f05d01ec2f
commit
62c33fbf69
3 changed files with 33 additions and 26 deletions
|
@ -17,7 +17,7 @@ HRESULT CExplorerBand_CreateInstance(REFIID riid, LPVOID *ppv);
|
|||
HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv);
|
||||
HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv);
|
||||
HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv);
|
||||
HRESULT CShellBrowser_CreateInstance(LPITEMIDLIST pidl, DWORD dwFlags, REFIID riid, void **ppv);
|
||||
HRESULT CShellBrowser_CreateInstance(REFIID riid, void **ppv);
|
||||
HRESULT CTravelLog_CreateInstance(REFIID riid, void **ppv);
|
||||
HRESULT CBaseBar_CreateInstance(REFIID riid, void **ppv, BOOL vertical);
|
||||
HRESULT CBaseBarSite_CreateInstance(REFIID riid, void **ppv, BOOL bVertical);
|
||||
|
|
|
@ -343,8 +343,7 @@ cleanup0:
|
|||
|
||||
static HRESULT ExplorerMessageLoop(IEThreadParamBlock * parameters)
|
||||
{
|
||||
CComPtr<IBrowserService2> browser;
|
||||
HRESULT hResult;
|
||||
HRESULT hResult;
|
||||
MSG Msg;
|
||||
BOOL Ret;
|
||||
|
||||
|
@ -366,26 +365,33 @@ static HRESULT ExplorerMessageLoop(IEThreadParamBlock * parameters)
|
|||
ILRemoveLastID(parameters->directoryPIDL);
|
||||
}
|
||||
|
||||
hResult = CShellBrowser_CreateInstance(parameters->directoryPIDL, wFlags, IID_PPV_ARG(IBrowserService2, &browser));
|
||||
CComPtr<IShellBrowser> psb;
|
||||
hResult = CShellBrowser_CreateInstance(IID_PPV_ARG(IShellBrowser, &psb));
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = psb->BrowseObject(parameters->directoryPIDL, wFlags);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
if (pidlSelect != NULL)
|
||||
{
|
||||
CComPtr<IShellBrowser> pisb;
|
||||
hResult = browser->QueryInterface(IID_PPV_ARG(IShellBrowser, &pisb));
|
||||
CComPtr<IShellView> shellView;
|
||||
hResult = psb->QueryActiveShellView(&shellView);
|
||||
if (SUCCEEDED(hResult))
|
||||
{
|
||||
CComPtr<IShellView> shellView;
|
||||
hResult = pisb->QueryActiveShellView(&shellView);
|
||||
if (SUCCEEDED(hResult))
|
||||
{
|
||||
shellView->SelectItem(pidlSelect, SVSI_SELECT|SVSI_ENSUREVISIBLE);
|
||||
}
|
||||
shellView->SelectItem(pidlSelect, SVSI_SELECT|SVSI_ENSUREVISIBLE);
|
||||
}
|
||||
ILFree(pidlSelect);
|
||||
}
|
||||
|
||||
CComPtr<IBrowserService2> browser;
|
||||
hResult = psb->QueryInterface(IID_PPV_ARG(IBrowserService2, &browser));
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
psb.Release();
|
||||
|
||||
while ((Ret = GetMessage(&Msg, NULL, 0, 0)) != 0)
|
||||
{
|
||||
if (Ret == -1)
|
||||
|
@ -617,7 +623,7 @@ BOOL WINAPI SHCreateFromDesktop(ExplorerCommandLineParseResults * parseResults)
|
|||
}
|
||||
|
||||
parameters->dwFlags = parseResults->dwFlags;
|
||||
parameters->offset8 = parseResults->offsetC;
|
||||
parameters->offset8 = parseResults->nCmdShow;
|
||||
|
||||
LPITEMIDLIST pidl = parseResults->pidlPath ? ILClone(parseResults->pidlPath) : NULL;
|
||||
if (!pidl && parseResults->dwFlags & SH_EXPLORER_CMDLINE_FLAG_STRING)
|
||||
|
|
|
@ -323,7 +323,7 @@ public:
|
|||
|
||||
CShellBrowser();
|
||||
~CShellBrowser();
|
||||
HRESULT Initialize(LPITEMIDLIST pidl, DWORD dwFlags);
|
||||
HRESULT Initialize();
|
||||
public:
|
||||
HRESULT BrowseToPIDL(LPCITEMIDLIST pidl, long flags);
|
||||
HRESULT BrowseToPath(IShellFolder *newShellFolder, LPCITEMIDLIST absolutePIDL,
|
||||
|
@ -723,7 +723,7 @@ CShellBrowser::~CShellBrowser()
|
|||
DSA_Destroy(menuDsa);
|
||||
}
|
||||
|
||||
HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, DWORD dwFlags)
|
||||
HRESULT CShellBrowser::Initialize()
|
||||
{
|
||||
CComPtr<IPersistStreamInit> persistStreamInit;
|
||||
HRESULT hResult;
|
||||
|
@ -792,15 +792,8 @@ HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, DWORD dwFlags)
|
|||
fStatusBarVisible = true;
|
||||
|
||||
|
||||
// browse
|
||||
hResult = BrowseToPIDL(pidl, BTP_UPDATE_NEXT_HISTORY);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
if ((dwFlags & SBSP_EXPLOREMODE) != NULL)
|
||||
ShowBand(CLSID_ExplorerBand, true);
|
||||
|
||||
ShowWindow(SW_SHOWNORMAL);
|
||||
UpdateWindow();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -1009,6 +1002,11 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
|
|||
saveCurrentShellView->DestroyViewWindow();
|
||||
fCurrentShellViewWindow = newShellViewWindow;
|
||||
|
||||
if (previousView == NULL)
|
||||
{
|
||||
RepositionBars();
|
||||
}
|
||||
|
||||
// no use
|
||||
saveCurrentShellView.Release();
|
||||
saveCurrentShellFolder.Release();
|
||||
|
@ -2252,7 +2250,10 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT w
|
|||
if ((wFlags & SBSP_EXPLOREMODE) != NULL)
|
||||
ShowBand(CLSID_ExplorerBand, true);
|
||||
|
||||
return BrowseToPIDL(pidl, BTP_UPDATE_CUR_HISTORY | BTP_UPDATE_NEXT_HISTORY);
|
||||
long flags = BTP_UPDATE_NEXT_HISTORY;
|
||||
if (fTravelLog)
|
||||
flags |= BTP_UPDATE_CUR_HISTORY;
|
||||
return BrowseToPIDL(pidl, flags);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CShellBrowser::GetViewStateStream(DWORD grfMode, IStream **ppStrm)
|
||||
|
@ -3782,7 +3783,7 @@ LRESULT CShellBrowser::RelayCommands(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
|
|||
return 0;
|
||||
}
|
||||
|
||||
HRESULT CShellBrowser_CreateInstance(LPITEMIDLIST pidl, DWORD dwFlags, REFIID riid, void **ppv)
|
||||
HRESULT CShellBrowser_CreateInstance(REFIID riid, void **ppv)
|
||||
{
|
||||
return ShellObjectCreatorInit<CShellBrowser>(pidl, dwFlags, riid, ppv);
|
||||
return ShellObjectCreatorInit<CShellBrowser>(riid, ppv);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue