www.pudn.com > ShortCutEx.rar > BkWnd.cpp, change:2004-08-09,size:3003b
//BkWnd.cpp : Implementation of CBkWnd //***************************************************************************// // // // This file was created using the CWindowImpl ATL Object Wizard // // By Erik Thompson © 2000 // // Version 1.1 // // Email questions and comments to ErikT@RadBytes.com // // // //***************************************************************************// #include "stdafx.h" #include "BkWnd.h" ///////////////////////////////////////////////////////////////////////////// // CBkWnd CBkWnd::CBkWnd() { } CBkWnd::~CBkWnd() { if (IsWindow()) DestroyWindow(); } const DWORD DEFAULT_TOOLBAR_STYLE = /*Window styles:*/ WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | WS_TABSTOP | /*Toolbar styles:*/ TBSTYLE_TOOLTIPS | TBSTYLE_FLAT |TBSTYLE_TRANSPARENT| TBSTYLE_LIST | TBSTYLE_CUSTOMERASE | TBSTYLE_WRAPABLE | TBSTYLE_DROPDOWN | /*Common Control styles:*/ CCS_TOP | CCS_NODIVIDER |CCS_NORESIZE;//| CCS_NOPARENTALIGN | ; const DWORD DEFAULT_BOTTON_STYLE = /*Window styles:*/ WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | WS_TABSTOP ;//| // /*Toolbar styles:*/ TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT |//| //TBSTYLE_LIST | TBSTYLE_CUSTOMERASE | // TBSTYLE_WRAPABLE | // /*Common Control styles:*/ CCS_TOP | CCS_NODIVIDER | CCS_NOPARENTALIGN ;//| CCS_NORESIZE; LRESULT CBkWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { RECT rectToolBar,rectButton; GetClientRect(&rectToolBar); rectButton = rectToolBar; rectToolBar.right -= 26; rectButton.left = rectToolBar.right+2; m_ToolBar.Create(m_hWnd, rectToolBar, NULL, DEFAULT_TOOLBAR_STYLE); // m_btnDelete.Create(m_hWnd, rectButton, NULL, DEFAULT_TOOLBAR_STYLE,0,BUTTON_ID); return 0; } LRESULT CBkWnd::OnDelButtonClick(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { return 0; } //LRESULT CBkWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) //{ // RECT rectToolBar,rectButton; // GetClientRect(&rectToolBar); // // rectButton = rectToolBar; // rectToolBar.right -= 26; // // rectButton.left = rectToolBar.right+2; // //// ClientToScreen() // // ::MoveWindow(m_ToolBar.m_hWnd,rectToolBar.left,rectToolBar.top, // rectToolBar.right-rectToolBar.left,rectToolBar.bottom - rectToolBar.top,TRUE); // ::MoveWindow(m_btnDelete.m_hWnd,rectButton.left,rectButton.top, // rectButton.right-rectButton.left,rectButton.bottom - rectButton.top,TRUE); // return 0; //} //LRESULT CBkWnd::OnDraw(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) //{ // HDC hDC = ::GetWindowDC(m_hWnd); // SetBkColor(hDC,GetSysColor(COLOR_WINDOW)); // return 0; //}