Пример #1
0
/***********************************************************************
 *    SHELL32_CoCreateInitSF
 *
 * Creates a shell folder and initializes it with a pidl and a root folder
 * via IPersistFolder3 or IPersistFolder.
 *
 * NOTES
 *   pathRoot can be NULL for Folders being a drive.
 *   In this case the absolute path is built from pidlChild (eg. C:)
 */
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
                LPCITEMIDLIST pidlChild, const GUID* clsid, REFIID riid, LPVOID *ppvOut)
{
    HRESULT hr;
    CComPtr<IShellFolder> pShellFolder;

    hr = SHCoCreateInstance(NULL, clsid, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
    if (FAILED(hr))
        return hr;

    LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
    CComPtr<IPersistFolder> ppf;
    CComPtr<IPersistFolder3> ppf3;

    if (ppfti && SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3))))
    {
        ppf3->InitializeEx(NULL, pidlAbsolute, ppfti);
    }
    else if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf))))
    {
        ppf->Initialize(pidlAbsolute);
    }
    ILFree (pidlAbsolute);

    return pShellFolder->QueryInterface(riid, ppvOut);
}
Пример #2
0
HRESULT CMenuFocusManager::IsTrackedWindowOrParent(HWND hWnd)
{
    for (int i = m_bandCount; --i >= 0;)
    {
        StackEntry& entry = m_bandStack[i];

        if (entry.type != TrackedMenuEntry)
        {
            HRESULT hr = entry.mb->IsWindowOwner(hWnd);
            if (FAILED_UNEXPECTEDLY(hr))
                return hr;
            if (hr == S_OK)
                return S_OK;
            if (entry.mb->_IsPopup() == S_OK)
            {
                CComPtr<IUnknown> site;
                CComPtr<IOleWindow> pw;
                hr = entry.mb->GetSite(IID_PPV_ARG(IUnknown, &site));
                if (FAILED_UNEXPECTEDLY(hr))
                    continue;
                hr = IUnknown_QueryService(site, SID_SMenuBandParent, IID_PPV_ARG(IOleWindow, &pw));
                if (FAILED_UNEXPECTEDLY(hr))
                    continue;

                HWND hParent;
                if (pw->GetWindow(&hParent) == S_OK && hParent == hWnd)
                    return S_OK;
            }
        }
    }

    return S_FALSE;
}
Пример #3
0
HRESULT STDMETHODCALLTYPE CBrandBand::SetSite(IUnknown* pUnkSite)
{
    CComPtr<IBrowserService>                browserService;
    CComPtr<IOleWindow>                     oleWindow;
    CComPtr<IServiceProvider>               serviceProvider;
    CComPtr<IProfferService>                profferService;
    HWND                                    parentWindow;
    HWND                                    hwnd;
    HRESULT                                 hResult;

    fSite.Release();
    if (pUnkSite == NULL)
    {
        hResult = AtlUnadvise(fSite, DIID_DWebBrowserEvents, fAdviseCookie);
        // TODO: revoke brand band service
        return S_OK;
    }

    // get window handle of parent
    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fSite));
    if (FAILED_UNEXPECTEDLY(hResult))
        return hResult;
    parentWindow = NULL;
    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
    if (SUCCEEDED(hResult))
        hResult = oleWindow->GetWindow(&parentWindow);
    if (!::IsWindow(parentWindow))
        return E_FAIL;

    // create worker window in parent window
    hwnd = SHCreateWorkerWindowW(0, parentWindow, 0,
        WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, NULL, 0);
    if (hwnd == NULL)
        return E_FAIL;
    SubclassWindow(hwnd);

    // take advice to watch events
    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
    if (SUCCEEDED(hResult))
    {
        hResult = serviceProvider->QueryService(
            SID_SBrandBand, IID_PPV_ARG(IProfferService, &profferService));
        if (SUCCEEDED(hResult))
            hResult = profferService->ProfferService(SID_SBrandBand,
                static_cast<IServiceProvider *>(this), &fProfferCookie);
        hResult = serviceProvider->QueryService(SID_SShellBrowser,
            IID_PPV_ARG(IBrowserService, &browserService));
        if (SUCCEEDED(hResult))
            hResult = AtlAdvise(browserService, static_cast<IDispatch *>(this), DIID_DWebBrowserEvents, &fAdviseCookie);
    }

    // ignore any hResult errors up to here - they are nonfatal
    hResult = S_OK;
    SelectImage();
    return hResult;
}
Пример #4
0
/***********************************************************************
 *    SHELL32_CoCreateInitSF
 *
 * Creates a shell folder and initializes it with a pidl and a root folder
 * via IPersistFolder3 or IPersistFolder.
 *
 * NOTES
 *   pathRoot can be NULL for Folders being a drive.
 *   In this case the absolute path is built from pidlChild (eg. C:)
 */
static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
                LPCITEMIDLIST pidlChild, REFCLSID clsid, IShellFolder** ppsfOut)
{
    HRESULT hr;
    CComPtr<IShellFolder> pShellFolder;

    TRACE ("%p %s %p\n", pidlRoot, debugstr_w(pathRoot), pidlChild);

    hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
    if (SUCCEEDED (hr))
    {
        LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
        CComPtr<IPersistFolder> ppf;
        CComPtr<IPersistFolder3> ppf3;

        if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3))))
        {
            PERSIST_FOLDER_TARGET_INFO ppfti;

            ZeroMemory (&ppfti, sizeof (ppfti));

            /* fill the PERSIST_FOLDER_TARGET_INFO */
            ppfti.dwAttributes = -1;
            ppfti.csidl = -1;

            /* build path */
            if (pathRoot)
            {
                lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
                PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
            }

            if (pidlChild)
            {
                int len = wcslen(ppfti.szTargetParsingName);

                if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
                    hr = E_INVALIDARG;
            }

            ppf3->InitializeEx(NULL, pidlAbsolute, &ppfti);
        }
        else if (SUCCEEDED((hr = pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf)))))
        {
            ppf->Initialize(pidlAbsolute);
        }
        ILFree (pidlAbsolute);
    }

    *ppsfOut = pShellFolder.Detach();

    TRACE ("-- (%p) ret=0x%08x\n", *ppsfOut, hr);

    return hr;
}
Пример #5
0
HRESULT SHELL32_BindToGuidItem(LPCITEMIDLIST pidlRoot,
                               PCUIDLIST_RELATIVE pidl,
                               LPBC pbcReserved,
                               REFIID riid,
                               LPVOID *ppvOut)
{
    CComPtr<IPersistFolder> pFolder;
    HRESULT hr;

    if (!pidlRoot || !ppvOut || !pidl || !pidl->mkid.cb)
        return E_INVALIDARG;

    *ppvOut = NULL;

    GUID *pGUID = _ILGetGUIDPointer(pidl);
    if (!pGUID)
    {
        ERR("SHELL32_BindToGuidItem called for non guid item!\n");
        return E_INVALIDARG;
    }

    hr = SHCoCreateInstance(NULL, pGUID, NULL, IID_PPV_ARG(IPersistFolder, &pFolder));
    if (FAILED(hr))
        return hr;

    if (_ILIsPidlSimple (pidl))
    {
        hr = pFolder->Initialize(ILCombine(pidlRoot, pidl));
        if (FAILED(hr))
            return hr;

        return pFolder->QueryInterface(riid, ppvOut);
    }
    else
    {
        LPITEMIDLIST pidlChild = ILCloneFirst (pidl);
        if (!pidlChild)
            return E_OUTOFMEMORY;

        hr = pFolder->Initialize(ILCombine(pidlRoot, pidlChild));
        ILFree(pidlChild);
        if (FAILED(hr))
            return hr;

        CComPtr<IShellFolder> psf;
        hr = pFolder->QueryInterface(IID_PPV_ARG(IShellFolder, &psf));
        if (FAILED(hr))
            return hr;

        return psf->BindToObject(ILGetNext (pidl), pbcReserved, riid, ppvOut);
    }
}
Пример #6
0
HRESULT WINAPI CDesktopFolder::FinalConstruct()
{
    WCHAR szMyPath[MAX_PATH];
    HRESULT hr;

    /* Create the root pidl */
    pidlRoot = _ILCreateDesktop();
    if (!pidlRoot)
        return E_OUTOFMEMORY;

    /* Create the inner fs folder */
    hr = SHELL32_CoCreateInitSF(pidlRoot, 
                                NULL,
                                NULL,
                                &CLSID_ShellFSFolder,
                                CSIDL_DESKTOPDIRECTORY,
                                IID_PPV_ARG(IShellFolder2, &m_DesktopFSFolder));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* Create the inner shared fs folder. Dont fail on failure. */
    hr = SHELL32_CoCreateInitSF(pidlRoot, 
                                NULL,
                                NULL,
                                &CLSID_ShellFSFolder,
                                CSIDL_COMMON_DESKTOPDIRECTORY,
                                IID_PPV_ARG(IShellFolder2, &m_SharedDesktopFSFolder));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* Create the inner reg folder */
    hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop,
                                   pidlRoot,
                                   L"", 
                                   IID_PPV_ARG(IShellFolder2, &m_regFolder));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* Cache the path to the user desktop directory */
    if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE ))
        return E_UNEXPECTED;

    sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
    if (!sPathTarget)
        return E_OUTOFMEMORY;

    wcscpy(sPathTarget, szMyPath);
    return S_OK;
}
Пример #7
0
HRESULT SHELL32_GetGuidItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
{
    if (!_ILIsSpecialFolder(pidl))
    {
        ERR("Got wrong type of pidl!\n");
        *pdwAttributes &= SFGAO_CANLINK;
        return S_OK;
    }

    if (*pdwAttributes & ~dwSupportedAttr)
    {
        WARN ("attributes 0x%08x not implemented\n", (*pdwAttributes & ~dwSupportedAttr));
        *pdwAttributes &= dwSupportedAttr;
    }

    /* First try to get them from the registry */
    if (HCR_GetFolderAttributes(pidl, pdwAttributes) && *pdwAttributes)
    {
        return S_OK;
    }
    else
    {
        /* If we can't get it from the registry we have to query the child */
        CComPtr<IShellFolder> psf2;
        if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder, &psf2))))
        {
            return psf2->GetAttributesOf(0, NULL, pdwAttributes);
        }
    }

    *pdwAttributes &= SFGAO_CANLINK;
    return S_OK;
}
Пример #8
0
HRESULT CBandSiteMenu::_AddISFBandToMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, IUnknown* pBand, DWORD dwBandID, UINT *newMenuId)
{
    CComPtr<IShellFolderBand> psfb;
    HRESULT hr = pBand->QueryInterface(IID_PPV_ARG(IShellFolderBand, &psfb));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    BANDINFOSFB bi = {ISFB_MASK_IDLIST};
    hr = psfb->GetBandInfoSFB(&bi);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    CComHeapPtr<ITEMIDLIST> pidl(bi.pidl);
    if (!pidl)
    {
        ERR("Failed to get the pidl of the CISFBand\n");
        return E_OUTOFMEMORY;
    }

    WCHAR buffer[MAX_PATH];
    hr = ILGetDisplayNameEx(NULL, pidl, buffer, ILGDN_INFOLDER) ? S_OK : E_FAIL;
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    UINT id = idCmdFirst + m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID + dwBandID;
    if (id >= idCmdLast)
        return E_FAIL;

    *newMenuId = id;
    InsertMenu(hmenu, indexMenu, MF_BYPOSITION, id, buffer);
    return S_OK;
}
Пример #9
0
/**************************************************************************
*        CFontsFolder::EnumObjects
*/
HRESULT WINAPI CFontsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
{
    CComObject<CDesktopFolderEnumZ>            *theEnumerator;
    CComPtr<IEnumIDList>                    result;
    HRESULT                                    hResult;

    TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);

    if (ppEnumIDList == NULL)
        return E_POINTER;
    *ppEnumIDList = NULL;
    ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumZ>);
    if (theEnumerator == NULL)
        return E_OUTOFMEMORY;
    hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
    if (FAILED (hResult))
    {
        delete theEnumerator;
        return hResult;
    }
    hResult = theEnumerator->Initialize (dwFlags);
    if (FAILED (hResult))
        return hResult;
    *ppEnumIDList = result.Detach ();

    TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);

    return S_OK;
}
Пример #10
0
HRESULT STDMETHODCALLTYPE CAddressBand::CloseDW(DWORD dwReserved)
{
    ShowDW(FALSE);

    if (IsWindow())
        DestroyWindow();

    m_hWnd = NULL;

    CComPtr<IShellService> pservice;
    HRESULT hres = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService, &pservice));
    if (SUCCEEDED(hres ))
        pservice->SetOwner(NULL);

    if (fAddressEditBox) fAddressEditBox.Release();
    if (fSite) fSite.Release();

    if (m_himlNormal)
        ImageList_Destroy(m_himlNormal);

    if (m_himlHot)
        ImageList_Destroy(m_himlHot);

    return S_OK;
}
Пример #11
0
HRESULT STDMETHODCALLTYPE CAddressBand::OnWinEvent(
    HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
{
    CComPtr<IWinEventHandler>               winEventHandler;
    HRESULT                                 hResult;
    RECT                                    rect;

    if (theResult)
        *theResult = 0;

    switch (uMsg)
    {
        case WM_WININICHANGE:
            break;
        case WM_COMMAND:
            if (wParam == IDM_TOOLBARS_GOBUTTON)
            {
                fGoButtonShown = !SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", FALSE, TRUE);
                SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", REG_SZ, fGoButtonShown ? (LPVOID)L"yes" : (LPVOID)L"no", fGoButtonShown ? 8 : 6, SHREGSET_FORCE_HKCU);
                if (!fGoButton)
                    CreateGoButton();
                ::ShowWindow(fGoButton,fGoButtonShown ? SW_HIDE : SW_SHOW);
                GetWindowRect(&rect);
                SendMessage(m_hWnd,WM_SIZE,0,MAKELPARAM(rect.right-rect.left,rect.bottom-rect.top));
                // broadcast change notification to all explorer windows
            }
            break;
    }
    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
    if (FAILED_UNEXPECTEDLY(hResult))
        return hResult;
    return winEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
}
Пример #12
0
HRESULT CMenuToolbarBase::UpdateImageLists()
{
    if ((m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL) // not vertical.
    {
        // No image list, prevents the buttons from having a margin at the left side
        SetImageList(NULL);
        return S_OK;
    }

    // Assign the correct imagelist and padding based on the current icon size

    int shiml;
    if (m_menuBand->UseBigIcons())
    {
        shiml = SHIL_LARGE;
        SetPadding(4, 0);
    }
    else
    {
        shiml = SHIL_SMALL;
        SetPadding(4, 4);
    }

    IImageList * piml;
    HRESULT hr = SHGetImageList(shiml, IID_PPV_ARG(IImageList, &piml));
    if (FAILED_UNEXPECTEDLY(hr))
    {
        SetImageList(NULL);
    }
    else
    {
        SetImageList((HIMAGELIST)piml);
    }
    return S_OK;
}
Пример #13
0
HRESULT CComCatCachedCategory::LoadFromComCatMgr()
{
    HRESULT hr;
    CComPtr<ICatInformation> pCatInformation;
    CComPtr<IEnumGUID> pEnumGUID;
    ULONG pFetched;
    CLSID tmp;

    // Get component categories manager instance
    hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
        IID_PPV_ARG(ICatInformation, &pCatInformation));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    // Get the proper enumerator
    hr = pCatInformation->EnumClassesOfCategories(1, &fCategory, NULL, NULL, &pEnumGUID);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    // Enumerate elements
    do
    {
        pFetched = 0;
        pEnumGUID->Next(1, &tmp, &pFetched);
        if (pFetched)
        {
            if (DSA_InsertItem(fLocalDsa, DSA_APPEND, &tmp) == E_OUTOFMEMORY)
                return E_OUTOFMEMORY;
        }
    }
    while (pFetched > 0);
    return S_OK;
}
Пример #14
0
HRESULT STDMETHODCALLTYPE CBandSiteMenu::SetOwner(IUnknown *pOwner)
{
    TRACE("CBandSiteMenu::SetOwner(%p, %p)\n", this, pOwner);
    
    /* Cache the menu that will be merged every time QueryContextMenu is called */
    _CreateMenuPart();

    return pOwner->QueryInterface(IID_PPV_ARG(IBandSite, &m_BandSite));
}
Пример #15
0
    STDMETHODIMP CQuickLaunchBand::Load(IN IStream *pStm)
    {
        CComPtr<IPersistStream> pIPS;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IPersistStream, &pIPS));
        if (FAILED(hr))
            return hr;

        return pIPS->Load(pStm);
    }
Пример #16
0
HRESULT CDesktopFolder::_GetSFFromPidl(LPCITEMIDLIST pidl, IShellFolder2** psf)
{
    WCHAR szFileName[MAX_PATH];

    lstrcpynW(szFileName, sPathTarget, MAX_PATH - 1);
    PathAddBackslashW(szFileName);
    int cLen = wcslen(szFileName);

    if (!_ILSimpleGetTextW(pidl, szFileName + cLen, MAX_PATH - cLen))
        return E_FAIL;

    ERR("%S\n", szFileName);

    if (GetFileAttributes(szFileName) == INVALID_FILE_ATTRIBUTES)
        return m_SharedDesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
    else
        return m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, psf));
}
Пример #17
0
    STDMETHODIMP CQuickLaunchBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize)
    {
        CComPtr<IPersistStream> pIPS;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IPersistStream, &pIPS));
        if (FAILED(hr))
            return hr;

        return pIPS->GetSizeMax(pcbSize);
    }
Пример #18
0
    STDMETHODIMP CQuickLaunchBand::GetSite(IN REFIID riid, OUT VOID **ppvSite)
    {        
        CComPtr<IObjectWithSite> pIOWS;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IObjectWithSite, &pIOWS));
        if (FAILED(hr))
            return hr;

        return pIOWS->GetSite(riid, ppvSite);
    }
Пример #19
0
HRESULT STDMETHODCALLTYPE CAddressBand::Refresh(long param8)
{
    CComPtr<IAddressBand>                   addressBand;
    HRESULT                                 hResult;

    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, &addressBand));
    if (FAILED_UNEXPECTEDLY(hResult))
        return hResult;
    return addressBand->Refresh(param8);
}
Пример #20
0
// *** IOleCommandTarget methods ***
    STDMETHODIMP CQuickLaunchBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
    {        
        // Internal CISFBand Calls
        CComPtr<IOleCommandTarget> pOCT;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &pOCT));
        if (FAILED(hr)) 
            return hr;

        return pOCT->QueryStatus(pguidCmdGroup, cCmds, prgCmds, pCmdText);
    }
Пример #21
0
    STDMETHODIMP CQuickLaunchBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
    {       
        // Internal CISFBand Calls
        CComPtr<IOleCommandTarget> pOCT;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &pOCT));
        if (FAILED(hr)) 
            return hr;

        return pOCT->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
    }  
Пример #22
0
HRESULT CSysTray::InitNetShell()
{
    HRESULT hr = CoCreateInstance(CLSID_ConnectionTray, 0, 1u, IID_PPV_ARG(IOleCommandTarget, &pctNetShell));
    if (FAILED(hr))
        return hr;

    return pctNetShell->Exec(&CGID_ShellServiceObject,
                             OLECMDID_NEW,
                             OLECMDEXECOPT_DODEFAULT, NULL, NULL);
}
Пример #23
0
// *** IContextMenu ***
    STDMETHODIMP CQuickLaunchBand::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
    {
        // Internal CISFBand Calls
        CComPtr<IContextMenu> pICM;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IContextMenu, &pICM));
        if (FAILED(hr)) 
            return hr;

        return pICM->GetCommandString(idCmd, uFlags, pwReserved, pszName, cchMax);
    }
Пример #24
0
HRESULT CFolder::GetShellFolder(CComPtr<IShellFolder>& psfCurrent)
{
    CComPtr<IShellFolder> psfDesktop;

    HRESULT hr = SHGetDesktopFolder(&psfDesktop);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    return psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, &psfCurrent));
}
Пример #25
0
    STDMETHODIMP CQuickLaunchBand::InvokeCommand(LPCMINVOKECOMMANDINFO pici)
    {
        // Internal CISFBand Calls
        CComPtr<IContextMenu> pICM;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IContextMenu, &pICM));
        if (FAILED(hr)) 
            return hr;

        return pICM->InvokeCommand(pici);
    }
Пример #26
0
    STDMETHODIMP CQuickLaunchBand::IsWindowOwner(HWND hWnd)
    {        
        // Internal CISFBand Calls
        CComPtr<IWinEventHandler> pWEH;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IWinEventHandler, &pWEH));
        if (FAILED(hr)) 
            return hr;

        return pWEH->IsWindowOwner(hWnd);
    }
Пример #27
0
    STDMETHODIMP CQuickLaunchBand::IsDirty()
    {        
        // Internal CISFBand Calls
        CComPtr<IPersistStream> pIPS;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IPersistStream, &pIPS));
        if (FAILED(hr))
            return hr;

        return pIPS->IsDirty();
    }
Пример #28
0
    STDMETHODIMP CQuickLaunchBand::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
    {
        // Internal CISFBand Calls
        CComPtr<IContextMenu> pICM;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IContextMenu, &pICM));
        if (FAILED(hr))
            return hr;

        return pICM->QueryContextMenu(hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
    }
Пример #29
0
    STDMETHODIMP CQuickLaunchBand::Save(IN IStream *pStm, IN BOOL fClearDirty)
    {       
        // Internal CISFBand Calls
        CComPtr<IPersistStream> pIPS;
        HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IPersistStream, &pIPS));
        if (FAILED(hr))
            return hr;

        return pIPS->Save(pStm, fClearDirty);
    }
Пример #30
0
    STDMETHODIMP CQuickLaunchBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
    {         
         // Internal CISFBand Calls
         CComPtr<IWinEventHandler> pWEH;
         HRESULT hr = m_punkISFB->QueryInterface(IID_PPV_ARG(IWinEventHandler, &pWEH));
         if (FAILED(hr)) 
             return hr;

         return pWEH->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
    }