sizecbar_demo.zip
SCBDemo
res
SCBDemo.ico
SCBDemoDoc.ico
Toolbar.bmp
SCBDemo.dsp
SCBDemo.dsw
SCBDemo2
res
SCBDemo.ico
SCBDemoDoc.ico
Toolbar.bmp
toolbar1.bmp
SCBDemo.dsp
SCBDemo.dsw
sizecbar_src.zip
Demo1
Demo1.dsp
Demo1.dsw
res
Demo1.ico
Demo1Doc.ico
Toolbar.bmp
Demo2
Demo2.dsp
Demo2.dsw
res
Demo2.ico
Demo2Doc.ico
Toolbar.bmp
toolbar1.bmp
src
|
// mybar.cpp : implementation file
//
#include "stdafx.h"
#include "mybar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyBar
CMyBar::CMyBar()
{
}
CMyBar::~CMyBar()
{
}
BEGIN_MESSAGE_MAP(CMyBar, baseCMyBar)
//{{AFX_MSG_MAP(CMyBar)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyBar message handlers
int CMyBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (baseCMyBar::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndChild.Create(WS_CHILD|WS_VISIBLE|
ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL,
CRect(0,0,0,0), this, 123))
return -1;
m_wndChild.ModifyStyleEx(0, WS_EX_CLIENTEDGE);
// older versions of Windows* (NT 3.51 for instance)
// fail with DEFAULT_GUI_FONT
if (!m_font.CreateStockObject(DEFAULT_GUI_FONT))
if (!m_font.CreatePointFont(80, "MS Sans Serif"))
return -1;
m_wndChild.SetFont(&m_font);
return 0;
}
void CMyBar::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
{
baseCMyBar::OnUpdateCmdUI(pTarget, bDisableIfNoHndler);
UpdateDialogControls(pTarget, bDisableIfNoHndler);
}
void CMyBar::OnSize(UINT nType, int cx, int cy)
{
baseCMyBar::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rc;
GetClientRect(rc);
m_wndChild.MoveWindow(rc);
}
void CMyBar::OnClose()
{
}
|
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here