#include "pch.h" #include "CMyFuncKeyToolBar.h" BEGIN_MESSAGE_MAP(CMyFuncKeyToolBar, CMFCToolBar) ON_WM_CREATE() ON_WM_SIZE() END_MESSAGE_MAP() /* structButton myButtons[] = { {33001,_T("11") }, {33002,_T("12") }, {33003,_T("13") }, {33004,_T("14") }, {33005,_T("15") }, {33006,_T("16") }, {33007,_T("17") }, {33008,_T("18") }, {33009,_T("19") }, {33010,_T("110") }, {33011,_T("111") }, {33012,_T("112") }, }; static int myButtonCount = sizeof(myButtons) / sizeof(structButton); */ int CMyFuncKeyToolBar::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMFCToolBar::OnCreate(lpCreateStruct) == -1) return -1; CRect rect1(0, 0, 100, 24); // TODO: ÔÚ´ËÌí¼ÓÄúרÓõĴ´½¨´úÂë // m_buttons[1].Create(myButtons[1].sCaption,WS_CHILD | WS_TABSTOP | WS_VISIBLE |BS_PUSHBUTTON ,rect1, this, myButtons[1].nID); CRect rect0(0, 0, 500, 48); this->MoveWindow(rect0); return 0; } void CMyFuncKeyToolBar::OnSize(UINT nType, int cx, int cy) { //CMFCToolBar::OnSize(nType, cx, cy); // CRect rect0(0, 0, 500, 48); // this->MoveWindow(rect0); // TODO: ÔÚ´Ë´¦Ìí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂë }