skinalterdlg.h

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

H
114
字号
// SkinAlterDlg.h : header file
//

#if !defined(AFX_SKINALTERDLG_H__74325701_D808_4D68_9903_64AE78EEC8C7__INCLUDED_)
#define AFX_SKINALTERDLG_H__74325701_D808_4D68_9903_64AE78EEC8C7__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CSkinAlterDlg dialog


typedef  CSkin* (__stdcall* fCreateSkinObj)();

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

#define fLeftBand     1
#define fLeftTitle    2
#define fRightTitle   4
#define fMidTitle     8
#define fRightBand    16
#define fBottomBand   32
#define fLeftBottom   64
#define fRightBottom  128
#define fMinButton    256
#define fMaxButton    512
#define fCloseButton  1024
#define fAll          2047


class CSkinAlterDlg : public CDialog
{
// Construction
public:

	CSkin*    pSkin;
	HINSTANCE hInstance;
	CBitmap   m_Bk;
	BOOL      m_LoadDll;  //是否加载Dll

	int       m_TitleDrawHeight;   //标题栏实际的绘制高度
	BOOL      m_IsMax;             //是否处于最大化状态
	int       m_BorderWidth;       //边框宽度
	int       m_BorderHeight;      //边框高度
	int       m_FrameWidth ;       //窗体3D宽度
	int       m_FrameHeight;       //窗体3D高度
	int       m_CaptionHeight;     //标题栏的高度
	CString   m_Caption;           //窗口标题
	COLORREF  m_CapitonColor;      //标题字体颜色
	CFont     m_CaptionFont;       //标题字体
	int       m_ButtonWidth;       //按钮位图宽度
	int       m_ButtonHeight;      //按钮位图高度

	
	BOOL      m_FirstShow;         //窗口首次被显示
	CRect     m_OrigonRect;        //原始窗口区域
	CRect     m_IniRect,m_MinRect,m_MaxRect,m_CloseRect; //标题栏按钮的显示区域
	CRect     m_LTitleRc, m_MTitleRc,m_RTitleRc;         //左标题,中间标题,右标题显示区域
	
	CButtonState m_ButtonState; //按钮状态
	BOOL         m_IsDrawForm;  //是否需要绘制窗体
	CRgn         WndRgn,ClipRgn;//创建显示和剪辑区域

public:
	void Skin();
	void SetWinZone();
	void OnCancel();
	void OnRestore();
	void DrawTitle();
	void SkinForm(UINT Flags =fAll);
	CSkinAlterDlg(CWnd* pParent = NULL);	// standard constructor

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

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

// Implementation
protected:
	HICON m_hIcon;

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

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

#endif // !defined(AFX_SKINALTERDLG_H__74325701_D808_4D68_9903_64AE78EEC8C7__INCLUDED_)

⌨️ 快捷键说明

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