WTL Controls
Back to the WTL Controls Home Page.
ToolTipPlus.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 //--------------------------------------------------------------------------------------
3 //--------------------------------------------------------------------------------------
4 //
5 //
6 // WTL Control Library
7 // by
8 // Bright Ideas Software®
9 // Copyright © 2018 by Bright Ideas Software.
10 //
11 //
12 //
13 //--------------------------------------------------------------------------------------
14 //--------------------------------------------------------------------------------------
15 
16 
17 namespace BIS_WTL_CONTROLS
18 {
19  //-------------------------------------------------------------------------------------------------------------
21  {
22  }
23  //-------------------------------------------------------------------------------------------------------------
25  {
26  }
27  //-------------------------------------------------------------------------------------------------------------
39  BOOL CToolTipPlus::AddWindowTool (HWND hWnd, LPCTSTR pszText)
40  {
41  TOOLINFO ti;
42  ti.cbSize = sizeof (TOOLINFO);
43  ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
44  ti.hwnd = ::GetParent (hWnd);
45  ti.uId = (UINT) hWnd;
46  ti.hinst = _Module.m_hInst;
47  ti.lpszText = (LPTSTR) pszText;
48 
49  return (BOOL) SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
50  }
51  //-------------------------------------------------------------------------------------------------------------
65  BOOL CToolTipPlus::AddRectTool (HWND hWnd, LPCTSTR pszText, LPCRECT lpRect, UINT nIDTool)
66  {
67  TOOLINFO ti;
68  ti.cbSize = sizeof (TOOLINFO);
69  ti.uFlags = TTF_SUBCLASS;
70  ti.hwnd = hWnd;
71  ti.uId = nIDTool;
72  ti.hinst = _Module.m_hInst;
73  ti.lpszText = (LPTSTR) pszText;
74  ::CopyRect (&ti.rect, lpRect);
75 
76  return (BOOL) SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
77  }
78  //-------------------------------------------------------------------------------------------------------------
79 };
BOOL AddRectTool(HWND pWnd, LPCTSTR pszText, LPCRECT pRect, UINT nIDTool)
Add a tooltip to an arbitrary rectangular region.
Definition: ToolTipPlus.cpp:65
BOOL AddWindowTool(HWND pWnd, LPCTSTR pszText)
Add a tooltip to a child window control.
Definition: ToolTipPlus.cpp:39