clockctl.h

来自「深入浅出Visual C++入门进阶与应用实例 随书光盘 作者 何志丹」· C头文件 代码 · 共 101 行

H
101
字号
#if !defined(AFX_CLOCKCTL_H__71533358_DAA1_440C_A97A_7EE8127DECD4__INCLUDED_)
#define AFX_CLOCKCTL_H__71533358_DAA1_440C_A97A_7EE8127DECD4__INCLUDED_

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

// ClockCtl.h : Declaration of the CClockCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CClockCtrl : See ClockCtl.cpp for implementation.
#include "lockObj.h"

class CClockCtrl : public COleControl
{
	DECLARE_DYNCREATE(CClockCtrl)

// Constructor
public:
	CClockCtrl();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CClockCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	//}}AFX_VIRTUAL

// Implementation
protected:
	~CClockCtrl();

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

// Message maps
	//{{AFX_MSG(CClockCtrl)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CClockCtrl)
	long m_crBkColor;
	afx_msg void OnCrBkColorChanged();
	long m_crHourPointerColor;
	afx_msg void OnCrHourPointerColorChanged();
	long m_crMinutePointerColor;
	afx_msg void OnCrMinutePointerColorChanged();
	long m_crSecondPointerColor;
	afx_msg void OnCrSecondPointerColorChanged();
	long m_crScaleColor;
	afx_msg void OnCrScaleColorChanged();
	afx_msg BOOL SetAlarmClock(short nHour, short nMinute, short nSecond);
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CClockCtrl)
	void FireTimeEnd()
		{FireEvent(eventidTimeEnd,EVENT_PARAM(VTS_NONE));}
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(CClockCtrl)
	dispidCrBkColor = 1L,
	dispidCrHourPointerColor = 2L,
	dispidCrMinutePointerColor = 3L,
	dispidCrSecondPointerColor = 4L,
	dispidCrScaleColor = 5L,
	dispidSetAlarmClock = 6L,
	eventidTimeEnd = 1L,
	//}}AFX_DISP_ID
	};

private:
	static UINT TimeFun(LPVOID lpPara);
	CClockObj	m_clock ;
	bool		m_bStopTimeFun ;
//	UINT		m_uTimer ;
	
};

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

#endif // !defined(AFX_CLOCKCTL_H__71533358_DAA1_440C_A97A_7EE8127DECD4__INCLUDED)

⌨️ 快捷键说明

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