📄 mjsplash.h
字号:
#if !defined(AFX_MJSPLASH_H__49EB182C_D848_483C_B348_53EAD56CC7DA__INCLUDED_)
#define AFX_MJSPLASH_H__49EB182C_D848_483C_B348_53EAD56CC7DA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MJSplash.h : header file
//
#include <afxtempl.h>
/////////////////////////////////////////////////////////////////////////////
// CMJSplash dialog
class CSplashString
{
public:
CSplashString(CString str,COLORREF cr,HFONT hf)
{
string=str;
color=cr;
hfont=hf;
}
CSplashString()
{
string="";
color=RGB(242,192,86);
hfont=NULL;
}
virtual ~CSplashString(){};
CSplashString &operator=(const CSplashString&sp)
{
if(&sp!=this)
{
string=sp.string;
color=sp.color;
hfont=sp.hfont;
}
return *this;
}
CString string;
COLORREF color;
HFONT hfont;
};
class CMJSplash : public CDialog
{
// Construction
public:
CMJSplash(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMJSplash)
enum { IDD = IDD_SPLASH };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
public:
void SetSplash(UINT uBmp);
void SetSplash(CString bmpPath);
void SetStrech(BOOL bStr=TRUE);
void AddSplashString(CString string,COLORREF cr=RGB(242,192,86),HFONT hFont=NULL);
void SetXPos(int x){m_xPos=x;}
void SetSpeed(int speed);
void SetColor(COLORREF color);
void Show();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMJSplash)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
BOOL LoadPictureFile( LPCTSTR szFile, CBitmap* pBitmap,
CSize& mSize);//把图片从文件调入
void DrawSplashText(CDC*pDC);
CBitmap m_bmpSplash;
CSize m_bmpSize;
int m_yPos;
int m_xPos;
int m_Speed;
int m_Height;
BOOL m_bStrech;
CRect m_rcClient;
CFont m_Font;
COLORREF m_crString;
CPtrArray m_SplashStrings;
// Generated message map functions
//{{AFX_MSG(CMJSplash)
afx_msg void OnPaint();
afx_msg void OnTimer(UINT nIDEvent);
virtual BOOL OnInitDialog();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MJSPLASH_H__49EB182C_D848_483C_B348_53EAD56CC7DA__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -