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

📄 a17tooltip.h

📁 vc制作指示语
💻 H
字号:
//
// $Id: tooltipwnd.h,v 1.5 1999/04/12 20:18:16 Guy_Brousseau Development gbrousse $
//

#if !defined(AFX_TOOLTIPWND_H__2C52D3E4_2F5B_11D2_8FC9_000000000000__INCLUDED_)
#define AFX_TOOLTIPWND_H__2C52D3E4_2F5B_11D2_8FC9_000000000000__INCLUDED_

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

// ToolTipWnd.h : header file


// --------------------------------------------------------------------------
const ID_TIMER_TOOLTIP_HIDE = 1;
const ID_TIMER_TOOLTIP_SHOW = 2;	


// --------------------------------------------------------------------------
struct BTOOLINFO
{
	CString  strToolText;
	COLORREF clrToolTextClr;
	UINT     iTimerDelay;		// in seconds
	UINT     iTimerDelayShow;	// in ms
};


//
// This struct is used by the EnumChildWindows function in the OnTimer Handler
//
typedef struct tagTTWndStruct 
{
	HWND	hWndToolTip;
	HWND	hWndToolTipParent;
} TTWNDSTRUCT;



// --------------------------------------------------------------------------
class CToolTipWnd : public CWnd
{
public:
	CToolTipWnd();
	virtual ~CToolTipWnd();

	bool m_bStuck; // stuck to mouse pointer when moving inside a control

	void RelayEvent( LPMSG );
	BOOL Create( CWnd *parent );

	void AddTool(CWnd *pWnd, CString strText, COLORREF clrTextColor = 0, int timerDelay = -1, int timerDelayShow = -1);

	void SetWidth( int iWidth );
	void SetHeight( int iHeight );
	void SetBkColor( COLORREF clrRef );
	void SetFrameColor( COLORREF clrRef );
	void SetDefTextColor( COLORREF clrRef );
	void SetFontHeight( int iHeight );
	void SetFontName( CString strFontName );
	void SetDelay( int iDelay );

	void Show( HWND hWnd, const char *overrideText = NULL, int timerDelay = -1, int timerDelayShow=-1);
	void Hide();

protected:
	//{{AFX_MSG(CToolTipWnd)
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg BOOL CToolTipWnd::PreTranslateMessage( MSG *pMsg );
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	LPCTSTR m_lpWndCls;
	HWND    m_hParentWnd;

	CFont   m_strTextFont;
	CRgn    m_rgn;
	CRgn    m_rgnTri;
	CRgn    m_rgnComb;	
	CRect   m_rectText;

	CMapPtrToPtr m_toolPtr;		// all tooltips specifications
	HWND         m_pCurrwnd;	// control for which a tooltip is currently displayed

	// Tooltip default parameters
	int      m_iWidth;
	int      m_iHeight;
	COLORREF m_clrBkColor;
	COLORREF m_clrFrameColor;
	COLORREF m_clrTextColor;
	int      m_iFontHeight;
	CString  m_strFontName;
	CString  m_strText;
	int      m_iDelay;
	int      m_iDelayShow;

	bool m_bSkipNextMove; // to skip the next WM_MOUSEMOVE message
	UINT m_iTimer;
	UINT m_iTimer2;

	void KillTimer();
	void SetTimer( int iDelay );
	void Show( int x, int y, int timerDelayHide, int timerDelayShow );


	void SetShowTimer(int iTimeTillShow);
	void KillShowTimer(void);
};


// --------------------------------------------------------------------------
// Inline Method:

inline void CToolTipWnd::SetWidth(int iWidth)				{m_iWidth = iWidth;}
inline void CToolTipWnd::SetHeight(int iHeight)				{m_iHeight = iHeight;}
inline void CToolTipWnd::SetBkColor(COLORREF clrRef)		{m_clrBkColor = clrRef;}
inline void CToolTipWnd::SetFrameColor(COLORREF clrRef)		{m_clrFrameColor = clrRef;}
inline void CToolTipWnd::SetDefTextColor( COLORREF clrRef)	{m_clrTextColor = clrRef;}
inline void CToolTipWnd::SetFontHeight(int iHeight)			{m_iFontHeight = iHeight;}
inline void CToolTipWnd::SetFontName(CString strFontName)	{m_strFontName = strFontName;}
inline void CToolTipWnd::SetDelay(int iDelay)				{m_iDelay = iDelay;}


//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TOOLTIPWND_H__2C52D3E4_2F5B_11D2_8FC9_000000000000__INCLUDED_)

⌨️ 快捷键说明

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