051: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
052: {
053:
054: // Tools Bars Setting
055:
056: if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
057: return -1;
058: // IDR_TOOLBAR1
059:
060: if (!m_wndToolBar.CreateEx(this, TBSTYLE_LIST | TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
061: | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
062: !m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))
063: {
064: TRACE0("Failed to create toolbar\n");
065: return -1; // fail to create
066: }
067:
068: if (!m_wndStatusBar.Create(this) ||
069: !m_wndStatusBar.SetIndicators(indicators,
070: sizeof(indicators)/sizeof(UINT)))
071: {
072: TRACE0("Failed to create status bar\n");
073: return -1; // fail to create
074: }
075:
076:
077: CImageList imageList;
078: CBitmap bitmap;
079: // Hot ToolBar의 hot상태의 ImageList를 생성 한다.
080: bitmap.LoadBitmap(IDB_TOOLBARS);
081: imageList.Create(24, 24, ILC_COLORDDB|ILC_MASK, 4, 1);
082: imageList.Add(&bitmap, RGB(255,0,255));
083: m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
084: imageList.Detach();
085: bitmap.Detach();
086:
087:
088:
089: // TODO: Delete these three lines if you don't want the toolbar to
090: // be dockable
091:
092: // button must be big enough to hold image
093: // + 7 pixels on x
094: // + 6 pixels on y
095: //
096:
097: m_wndToolBar.SetSizes(CSize(80,30),CSize(24,24));
098: UINT nID, nStyle;
099: int iImage;
100:
101: for (int i=0; i<3; i++)
102: {
103: m_wndToolBar.GetButtonInfo(i, nID, nStyle, iImage);
104: nStyle |= TBSTYLE_BUTTON | TBBS_AUTOSIZE;
105: m_wndToolBar.SetButtonInfo(i, nID, nStyle, iImage);
106: }
107:
108: m_wndToolBar.SetButtonText(0,"로그인");
109: m_wndToolBar.SetButtonText(1,"업로드");
110: m_wndToolBar.SetButtonText(2,"환경설정");
111:
112:
113: m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
114: EnableDocking(CBRS_ALIGN_ANY);
115: DockControlBar(&m_wndToolBar);
116:
117: return 0;
118: }
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기