gamblerctrlctl.h

来自「《VC++ 编程技巧与示例 .rar》各个示例代码绝对可用」· C头文件 代码 · 共 110 行

H
110
字号
#if !defined(AFX_GAMBLERCTRLCTL_H__B046B1F6_B07D_11D3_9460_0000000038B2__INCLUDED_)
#define AFX_GAMBLERCTRLCTL_H__B046B1F6_B07D_11D3_9460_0000000038B2__INCLUDED_

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

// GamblerCtrlCtl.h : Declaration of the CGamblerCtrlCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CGamblerCtrlCtrl : See GamblerCtrlCtl.cpp for implementation.

class CGamblerCtrlCtrl : public COleControl
{
	DECLARE_DYNCREATE(CGamblerCtrlCtrl)

// Constructor
public:
	CGamblerCtrlCtrl();
	//相关尺寸数据:
	UINT bl;
	UINT rl;
	UINT sp;
	UINT cx;
	UINT cy;
	CRect rcAnte;
	CRect rcStart;
	//输入:
	CComboBox m_Ante;
	//开始:
	CBitmapButton m_Start;
	afx_msg void OnStart();
	int m_Number;
	int Counter;
	CString Items[10];
	//可以改变的属性:
	//将要显示的字符:
	CString m_Show;
	CString m_Title;
	OLE_COLOR m_BkColor;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGamblerCtrlCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	//}}AFX_VIRTUAL

// Implementation
protected:
	~CGamblerCtrlCtrl();

	DECLARE_OLECREATE_EX(CGamblerCtrlCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CGamblerCtrlCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CGamblerCtrlCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CGamblerCtrlCtrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(CGamblerCtrlCtrl)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CGamblerCtrlCtrl)
	CString m_showString;
	afx_msg void OnShowStringChanged();
	OLE_COLOR m_panelColor;
	afx_msg void OnPanelColorChanged();
	afx_msg BSTR GetTitle();
	afx_msg void SetTitle(LPCTSTR lpszNewValue);
	afx_msg OLE_COLOR GetBackColor();
	afx_msg void SetBackColor(OLE_COLOR nNewValue);
	afx_msg short GetHint(short guess);
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CGamblerCtrlCtrl)
	void FireGuessRight()
		{FireEvent(eventidGuessRight,EVENT_PARAM(VTS_NONE));}
	void FireGuessWrong()
		{FireEvent(eventidGuessWrong,EVENT_PARAM(VTS_NONE));}
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(CGamblerCtrlCtrl)
	dispidTitle = 3L,
	dispidShowString = 1L,
	dispidBackColor = 4L,
	dispidPanelColor = 2L,
	dispidGetHint = 5L,
	eventidGuessRight = 1L,
	eventidGuessWrong = 2L,
	//}}AFX_DISP_ID
	};
};

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

#endif // !defined(AFX_GAMBLERCTRLCTL_H__B046B1F6_B07D_11D3_9460_0000000038B2__INCLUDED)

⌨️ 快捷键说明

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