Sample Code

Windows Driver Samples/ Microsoft slate system virtual audio device driver sample/ C++/ SwapAPO/ PropPageExtensions/ SwapPropPage.h/

//**@@@*@@@****************************************************
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//**@@@*@@@****************************************************

//
// FileName:    SwapPropPage.h
//
// Abstract:    Declaration of the CSwapPropPage class
//
// ----------------------------------------------------------------------------


#pragma once

// ----------------------------------------------------------------------
// CSwapPropPage class
//
class ATL_NO_VTABLE CSwapPropPage :
    public CComObjectRootEx<CComSingleThreadModel>,
    public CComCoClass<CSwapPropPage, &CLSID_SwapPropPage>,
    public IDispatchImpl<ISwapPropPage, &__uuidof(ISwapPropPage), &LIBID_CplExtLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
    public IShellExtInit,
    public IShellPropSheetExt
{
public:
    CSwapPropPage();
    ~CSwapPropPage();

    DECLARE_REGISTRY_RESOURCEID(IDR_SWAP_PROP_PAGE)

    BEGIN_COM_MAP(CSwapPropPage)
        COM_INTERFACE_ENTRY(ISwapPropPage)
        COM_INTERFACE_ENTRY(IDispatch)
        COM_INTERFACE_ENTRY(IShellExtInit)
        COM_INTERFACE_ENTRY(IShellPropSheetExt)
    END_COM_MAP()

    DECLARE_PROTECT_FINAL_CONSTRUCT()

    HRESULT FinalConstruct()
    {
        return S_OK;
    }

    void FinalRelease()
    {
    }

    static INT_PTR CALLBACK DialogProcPage1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
    static UINT CALLBACK PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);

    // IShellExtInit
    STDMETHOD(Initialize)(_In_opt_ LPCITEMIDLIST pidlFolder, _In_opt_ IDataObject* pdtobj, _In_opt_ HKEY hkeyProgID);

    // IShellPropSheetExt
    STDMETHOD(AddPages)(_In_ LPFNADDPROPSHEETPAGE lpfnAddPage, _In_ LPARAM lParam);
    STDMETHOD(ReplacePage)(_In_ UINT uPageID, _In_ LPFNSVADDPROPSHEETPAGE lpfnReplaceWith, _In_ LPARAM lParam);

private:
    AudioFXExtensionParams* m_pAudioFXExtParams;
    BOOL m_fDisableSysFX;
    BOOL m_fEnableSwapLFX;
    BOOL m_fEnableSwapGFX;

    HRESULT GetDeviceFriendlyName(_Outptr_result_maybenull_ LPWSTR* ppNameOut);
    HRESULT RetrieveSysFXState();
    HRESULT SetSysFXState();
    HRESULT RetrieveSwapLFXState();
    HRESULT SetSwapLFXState();
    HRESULT RetrieveSwapGFXState();
    HRESULT SetSwapGFXState();

    BOOL OnInitDialog(HWND hwndDlg, WPARAM wParam, LPARAM lParam);
    BOOL OnApply(HWND hwndDlg);
    BOOL OnCheckBoxClickedDisableSysFX(HWND hwndDlg);
    BOOL OnCheckBoxClickedEnableSwapLFX(HWND hwndDlg);
    BOOL OnCheckBoxClickedEnableSwapGFX(HWND hwndDlg);
};

OBJECT_ENTRY_AUTO(__uuidof(SwapPropPage), CSwapPropPage)

Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS