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

📄 readme.wzd

📁 《vc++扩展编程实例》源码。运用Visual C++ 5.0或6.0的高级编程技巧
💻 WZD
字号:
/////////////////////////////////////////////////////////////////////
// Example files...
/////////////////////////////////////////////////////////////////////

WzdTlTip.cpp -- a tooltip class that uses subclassing to capture mouse
WzdTlTip.h       messages

/////////////////////////////////////////////////////////////////////
// To Add Bubble Help to a View, Modify the View Class....
/////////////////////////////////////////////////////////////////////

// 1) Embed the CWzdToolTipCtrl class from WzdTlTip.cpp in the View Class:

	CWzdToolTipCtrl m_tooltips;

// 2) Add a WM_CREATE message handler and create bubble help window:

	m_tooltips.Create(this);

// 3) Also in this handler, define areas of the View which will display a 
// bubble help message:

	m_tooltips.AddArea(
			1,				// user defined id
			&rect1,			// a CRect value defining the area in view coordinates
			"message",		// the bubble help message
			);

// 4) Finally, activate the tooltip:

	m_tooltips.Activate(TRUE);

// 5) To update the help message at another point:

	m_tooltips.UpdateTipText(
			"new text",		// the new text message
			this,			// pointer to view class
			1				// the id defined above
			);

// 6) To change the area this id refers provides help for:

	m_tooltips.SetToolRect(
			this,			// pointer to view class
			1,				// the id defined above
			&rect			// a new CRect value defining the area in view coordinates
			);


/////////////////////////////////////////////////////////////////////
// To Add Bubble Help to a Dialog, Modify the Dialog Class....
/////////////////////////////////////////////////////////////////////

// 1) Embed the CWzdToolTipCtrl class from WzdTlTip.cpp in the Dialog Class:

	CWzdToolTipCtrl m_tooltips;

// 2) Add a WM_INITDIALOG message handler and create bubble help window:

	m_tooltips.Create(this);

// 3) Also in this handler, specify the help message for any control you
// want bubble help for:

	m_tooltips.AddTool(
		IDC_RADIO1,			// control id
		"Radio Control"		// bubble help message
		);

// NOTE: For static controls, you must use the Parent notify style for mouse
// messages to be subclassed.

// 4) Fianlly, activate the tooltip:

	m_tooltips.Activate(TRUE);

// 5) To change the help for a control at another point, use:

	m_tooltips.UpdateTipText(
		"Checked Box",				// new text
		GetDlgItem(
			IDC_CHECK1				// the control's id
			)
		);
	


/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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