⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawform.h

📁 VC经典换肤程序,很好使用
💻 H
字号:
// DrawForm.h : main header file for the DRAWFORM application
//

#if !defined(AFX_DRAWFORM_H__48E37594_5C00_40A3_B11F_7F84F0AC47A4__INCLUDED_)
#define AFX_DRAWFORM_H__48E37594_5C00_40A3_B11F_7F84F0AC47A4__INCLUDED_

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

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"		// main symbols

/////////////////////////////////////////////////////////////////////////////
// CDrawFormApp:
// See DrawForm.cpp for the implementation of this class
//

class CMemDC : public CDC 
{
private:
	CBitmap*	m_bmp;
	CBitmap*	m_oldbmp;
	CDC*		m_pDC;
	CRect		m_Rect;
public:
	CMemDC(CDC* pDC, const CRect& rect) : CDC()
	{
		CreateCompatibleDC(pDC);
		m_bmp = new CBitmap;
		m_bmp->CreateCompatibleBitmap(pDC, rect.Width(), rect.Height());
		m_oldbmp = SelectObject(m_bmp);
		m_pDC = pDC;
		m_Rect = rect;
	}
	~CMemDC() 
	{
		m_pDC->BitBlt(m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height(), 
				this, m_Rect.left, m_Rect.top, SRCCOPY);
		SelectObject(m_oldbmp);
		if (m_bmp != NULL) 
			delete m_bmp;
	}
};

class  CFormPart
{
public:
	HBITMAP  m_hBitmap;  //位图资源
	CRect   m_Rect;      //位图资源位置,该位置是相对于右标题部分的相对位置,只对标题栏按钮起作用
};

class CSkin
{
protected:
	UINT m_PartCount;    //窗体由几部分组成
	//窗体各部分位图资源:0,1,2分别为标题栏的左\中\右3部分
	//3,4,5分别为左,下,右边框,6,7,8,9,10,11为标题栏普通按钮和热点按钮
	CFormPart* m_pParts;
public:
	//加载位图资源
	virtual HBITMAP GetBitmapRes(UINT Index) = 0;
	virtual Release()= 0;
	virtual CPoint GetButtonPos(UINT Index)=0;
	virtual BOOL GetDrawRound()=0;
};

typedef  CSkin* (__stdcall* fCreateSkinObj)();

class CDrawFormApp : public CWinApp
{
public:
	BOOL ChangeSkin(LPCTSTR lpFileName);
	CDrawFormApp();
	CSkin*    pSkin;
	HINSTANCE m_Instance;
	BOOL      m_LoadDll;  //是否加载Dll
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDrawFormApp)
	public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	//}}AFX_VIRTUAL

// Implementation

	//{{AFX_MSG(CDrawFormApp)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


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

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

#endif // !defined(AFX_DRAWFORM_H__61089531_AABC_476F_802C_8A29A17D1F0E__INCLUDED_)

⌨️ 快捷键说明

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