drawdialogdlg.h

来自「《Visual C++视频技术方案宝典》配套光盘」· C头文件 代码 · 共 96 行

H
96
字号
// DrawDialogDlg.h : header file
//

#if !defined(AFX_DRAWDIALOGDLG_H__7603CE51_E99A_4047_AB3E_ED731BCCB6B6__INCLUDED_)
#define AFX_DRAWDIALOGDLG_H__7603CE51_E99A_4047_AB3E_ED731BCCB6B6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CDrawDialogDlg dialog

#define fLeftBar      1    //左边框
#define fLeftTitle    2    //左标题
#define fRightTitle   4    //右标题
#define fMidTitle     8    //中间标题
#define fRightBar     16   //右边框
#define fBottomBar    32   //底边框
#define fMinButton    64   //最小化按钮
#define fMaxButton    128  //最大化按钮
#define fCloseButton  256  //关闭按钮
#define fAll          511  //所有标识

//按钮状态
enum CButtonState{bsNone,bsMin,bsMax,bsRes,bsClose};

class CDrawDialogDlg : public CDialog
{
// Construction
public:
	void DrawCaption();
	void DrawDialog(UINT Flags =fAll);
	CDrawDialogDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CDrawDialogDlg)
	enum { IDD = IDD_DRAWDIALOG_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDrawDialogDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	CBitmap m_BKGround;
	CString m_Caption;
	CButtonState m_ButtonState;
	BOOL         m_IsMax;

	int       m_BorderWidth;       //边框宽度
	int       m_BorderHeight;      //边框高度
	int       m_FrameWidth ;       //窗体3D宽度
	int       m_FrameHeight;       //窗体3D高度
	int       m_CaptionHeight;     //标题栏的高度
	int       m_TitleDrawHeight;   //标题栏实际的绘制高度

	int       m_ButtonWidth;       //按钮位图宽度
	int       m_ButtonHeight;      //按钮位图高度
	COLORREF  m_CapitonColor;      //标题字体颜色
	CFont     m_CaptionFont;       //标题字体

	BOOL      	m_IsDrawForm ;

	CRect m_LTitleRc, m_MTitleRc,m_RTitleRc; //左标题,中间标题,右标题显示区域
	CRect m_MinRect,m_MaxRect,m_CloseRect;   //标题栏按钮的显示区域

	// Generated message map functions
	//{{AFX_MSG(CDrawDialogDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnOK();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
	afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
	afx_msg BOOL OnNcActivate(BOOL bActive);
	afx_msg void OnNcPaint();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_DRAWDIALOGDLG_H__7603CE51_E99A_4047_AB3E_ED731BCCB6B6__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?