ToolbarWindow.h


#pragma once
#include "atlwin.h"

class CToolbarWindow : public CWindowImpl<CToolbarWindow>
{
public:
    DECLARE_WND_SUPERCLASS(TEXT("CTOOLBARWINDOW"), TOOLBARCLASSNAME)

    BEGIN_MSG_MAP(CToolbarWindow)
        MESSAGE_HANDLER(WM_CREATE, OnCreate)
        COMMAND_ID_HANDLER(1000, OnKumaButton)
        //クマメニュー1の動作
        COMMAND_ID_HANDLER(1001, OnKumaMenuOne)
        //クマメニュー2の動作
        COMMAND_ID_HANDLER(1002, OnKumaMenuTwo)
        NOTIFY_CODE_HANDLER (TBN_DROPDOWN, OnDropDown)
    END_MSG_MAP()

    //WM_CREATE時の処理
    LRESULT OnCreate      ( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled  );
    LRESULT OnKumaButton  ( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
    //クマメニュー1の動作
    LRESULT OnKumaMenuOne ( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
    //クマメニュー2の動作
    LRESULT OnKumaMenuTwo ( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
    LRESULT OnDropDown    ( int idCtrl, LPNMHDR pnmh, BOOL& bHandled );

    CToolbarWindow(void);
    virtual ~CToolbarWindow(void);

    //void AddButton  (int idCommand, int type, wchar_t* string, wchar_t* bitmapPath, 
    void SetBrowser (CComPtr<IWebBrowser2> spWebBrowser2) { m_spBrowser.Attach(spWebBrowser2); }

private:
    HIMAGELIST m_hImageList;
    CComPtr<IWebBrowser2> m_spBrowser;
};

戻る

コメントスペース