Click here to Skip to main content
15,886,362 members
Articles / Desktop Programming / MFC

Pinnable ControlBar

Rate me:
Please Sign up or sign in to vote.
4.81/5 (28 votes)
4 Dec 2003CPOL1 min read 187.2K   3.6K   65  
This article is based on Cristi Posea's CSizeControlBar
#if !defined(AFX_DRAWFRAME_H__EF0EC395_D6D3_42D2_B68C_6FAB10C90B58__INCLUDED_)
#define AFX_DRAWFRAME_H__EF0EC395_D6D3_42D2_B68C_6FAB10C90B58__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DrawFrame.h : header file
//

#define WM_SHOWIT WM_USER + 1
#define WM_SHOWHIDE WM_USER + 2
#define WM_SHOWDOCKBAR WM_USER + 3
/////////////////////////////////////////////////////////////////////////////
// CDrawFrame window
class CAutoHideBar;

class CDrawFrame : public CWnd
{
// Construction
public:
	CDrawFrame();

// Attributes
public:
	int	m_Size;
	CAutoHideBar * m_pDrawBar;
	int m_TitleHeight;
	CString m_Title;
	CString m_sFontFace;
	CSCBPushPinButton m_PushPin;
	BOOL m_bShowOff;
	BOOL m_bActive;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDrawFrame)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CDrawFrame();

	// Generated message map functions
protected:
	//{{AFX_MSG(CDrawFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	afx_msg BOOL OnNcActivate(BOOL bActive);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg UINT OnNcHitTest(CPoint point);
	afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnNcPaint();
	afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
	afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
	afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
	//}}AFX_MSG
	afx_msg LRESULT ShowOff(WPARAM, LPARAM);
	afx_msg LRESULT ShowHide(WPARAM, LPARAM);
	LRESULT CDrawFrame::ShowDockBar(WPARAM, LPARAM);
	void OnUpdateCmdUI(CFrameWnd* pTarget,
                                      BOOL bDisableIfNoHndler);

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DRAWFRAME_H__EF0EC395_D6D3_42D2_B68C_6FAB10C90B58__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions