2017-01-30 25 views
1

我是名稱空間擴展的新手。我試圖爲命名空間擴展禁用導航窗格。如何獲取GetFolder(IID_ExplorerPaneVisibility)調用

我有我的殼視圖實現實現IFolderView :: GetFolder它返回一個IShellFolder對象。 Shell Folder類正在實現IExplorerPaneVisibility :: GetPaneState方法。

但我沒有得到GetFolder(IID_ExplorerPaneVisibility)調用。有人可以幫我弄這個嗎?

STDMETHODIMP ShellFolderViewImpl::GetFolder(REFIID riid, VOID ** ppv) 
{ 
    if (riid == IID_IExplorerPaneVisibility) 
    { 
     this->QueryInterface(riid, (void**)ppv); 
    } 
    return S_OK; 
} 

STDMETHODIMP ShellFolderViewImpl::GetPaneState(REFEXPLORERPANE ep,EXPLORERPANESTATE * peps) 
{ 
    if (ep == EP_NavPane) 
     *peps = EPS_DEFAULT_OFF; 
    else if (ep == EP_Commands) 
     *peps = EPS_DEFAULT_OFF; 
    else if (ep == EP_DetailsPane) 
     *peps = EPS_DEFAULT_OFF; 
    else if (ep == EP_AdvQueryPane) 
     *peps = EPS_DEFAULT_OFF; 
    else if (ep == EP_QueryPane) 
     *peps = EPS_DEFAULT_OFF; 
    else 
     *peps = EPS_DONTCARE; 
    return S_OK; 
} 

回答

0

MSDN說

的IExplorerPaneVisibility實現從殼牌 文件夾檢索。 Shell文件夾又從視圖中檢索。

我把這解釋爲;它會去QueryInterface你的IShellFolder來獲得你的IExplorerPaneVisibility實現。

您還應該檢查this newsgroup thread,它顯示了一些您可能需要關閉一些窗格的解決方法。

我希望你的代碼不是你真正的實現,你永遠不應該在GetFolder中返回S_OK來處理你不認識的事情!