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

📄 tooltips.cpp

📁 这些源代码
💻 CPP
字号:
// ToolTips.cpp : implementation file
//

#include "stdafx.h"
#include "Controls.h"
#include "ToolTips.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CToolTips

CToolTips::CToolTips()
{
}

CToolTips::~CToolTips()
{
}


BEGIN_MESSAGE_MAP(CToolTips, CToolTipCtrl)
	//{{AFX_MSG_MAP(CToolTips)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CToolTips message handlers

BOOL CToolTips::AddControl(CWnd *pCtrl, LPCSTR pszText)
{
	TOOLINFO ti;
	ti.cbSize = sizeof (TOOLINFO);
	ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
	ti.hwnd = pCtrl->GetParent()->GetSafeHwnd();
	ti.uId = (UINT) pCtrl->GetSafeHwnd ();
	ti.hinst = 0;//AfxGetInstanceHandle ();
	ti.lpszText = (LPTSTR) pszText;

	BOOL bResult = SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
	return (bResult);
}

BOOL CToolTips::AddControl(CWnd *pCtrl, UINT nID)
{
	return (AddControl(pCtrl, MAKEINTRESOURCE(nID)));
}

BOOL CToolTips::AddRect(CWnd *pParent, UINT nID, CRect &rc, LPCSTR pszText)
{
	TOOLINFO ti;
	ti.cbSize = sizeof (TOOLINFO);
	ti.uFlags = 0;
	ti.hwnd = pParent->m_hWnd;
	ti.uId = nID;
	ti.hinst = AfxGetInstanceHandle ();
	ti.lpszText = (LPTSTR) pszText;
	ti.rect = rc;
	BOOL bResult = SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
	return (bResult);
}

⌨️ 快捷键说明

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