ReactOS  0.4.12-dev-75-g00dd17e
ToolTip Struct Reference

encapsulation of tool tip controls More...

#include <window.h>

Inheritance diagram for ToolTip:
Collaboration diagram for ToolTip:

Public Types

typedef WindowHandle super
 

Public Member Functions

 ToolTip (HWND owner)
 
void activate (BOOL active=TRUE)
 
void add (HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
 
void add (HWND hparent, UINT id, const RECT &rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
 
void remove (HWND hparent, HWND htool)
 
void remove (HWND hparent, UINT id)
 

Detailed Description

encapsulation of tool tip controls

Definition at line 850 of file window.h.

Member Typedef Documentation

◆ super

typedef WindowHandle ToolTip::super

Definition at line 852 of file window.h.

Constructor & Destructor Documentation

◆ ToolTip()

ToolTip::ToolTip ( HWND  owner)

Definition at line 1265 of file window.cpp.

1268  owner, 0, g_Globals._hInstance, 0))
1269 {
1270  activate();
1271 }
#define TOOLTIPS_CLASS
Definition: commctrl.h:1680
#define TTS_ALWAYSTIP
Definition: commctrl.h:1727
#define CreateWindowEx
Definition: winuser.h:5621
#define CW_USEDEFAULT
Definition: winuser.h:225
void activate(BOOL active=TRUE)
Definition: window.h:856
WindowHandle super
Definition: window.h:852
HINSTANCE _hInstance
Definition: globals.h:270
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_EX_NOPARENTNOTIFY
Definition: pedump.c:646
#define WS_POPUP
Definition: pedump.c:616
#define TTS_NOPREFIX
Definition: commctrl.h:1728

Member Function Documentation

◆ activate()

void ToolTip::activate ( BOOL  active = TRUE)
inline

Definition at line 856 of file window.h.

Referenced by ToolTip().

857  {
858  SendMessage(_hwnd, TTM_ACTIVATE, active, 0);
859  }
#define TTM_ACTIVATE
Definition: commctrl.h:1754
#define SendMessage
Definition: winuser.h:5709

◆ add() [1/2]

void ToolTip::add ( HWND  hparent,
HWND  htool,
LPCTSTR  txt = LPSTR_TEXTCALLBACK,
LPARAM  lparam = 0 
)
inline
Todo:
Why is it neccesary to try both TTM_ADDTOOLW and TTM_ADDTOOLW ?!

Definition at line 861 of file window.h.

Referenced by ClockWindow::ClockWindow(), and NotifyArea::UpdateIcons().

862  {
863  TOOLINFO ti = {
864  sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND|TTF_TRANSPARENT, hparent, (UINT_PTR)htool,
865  {0,0,0,0}, 0, (LPTSTR)txt, lparam
866  };
867 
868 #ifdef UNICODE
869  if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
870  SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
871 #else
872  if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
873  SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
874 #endif
875  }
#define TOOLINFO
Definition: commctrl.h:1688
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define TTM_ADDTOOLA
Definition: commctrl.h:1756
LONG_PTR LPARAM
Definition: windef.h:208
#define TTF_IDISHWND
Definition: commctrl.h:1734
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
#define TTM_ADDTOOLW
Definition: commctrl.h:1757
#define TTF_TRANSPARENT
Definition: commctrl.h:1740
#define SendMessage
Definition: winuser.h:5709
#define TTF_SUBCLASS
Definition: commctrl.h:1737

◆ add() [2/2]

void ToolTip::add ( HWND  hparent,
UINT  id,
const RECT rect,
LPCTSTR  txt = LPSTR_TEXTCALLBACK,
LPARAM  lparam = 0 
)
inline

Definition at line 877 of file window.h.

878  {
879  TOOLINFO ti = {
880  sizeof(TOOLINFO), TTF_SUBCLASS|TTF_TRANSPARENT, hparent, id,
881  {rect.left,rect.top,rect.right,rect.bottom}, 0, (LPTSTR)txt, lparam
882  };
883 
884 #ifdef UNICODE
885  if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
886  SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
887 #else
888  if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
889  SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
890 #endif
891  }
#define TOOLINFO
Definition: commctrl.h:1688
LONG top
Definition: windef.h:297
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define TTM_ADDTOOLA
Definition: commctrl.h:1756
LONG_PTR LPARAM
Definition: windef.h:208
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
#define TTM_ADDTOOLW
Definition: commctrl.h:1757
#define TTF_TRANSPARENT
Definition: commctrl.h:1740
#define SendMessage
Definition: winuser.h:5709
LONG bottom
Definition: windef.h:299
#define TTF_SUBCLASS
Definition: commctrl.h:1737

◆ remove() [1/2]

void ToolTip::remove ( HWND  hparent,
HWND  htool 
)
inline

Definition at line 893 of file window.h.

Referenced by NotifyArea::UpdateIcons().

894  {
895  TOOLINFO ti = {
896  sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT_PTR)htool,
897  {0,0,0,0}, 0, 0, 0
898  };
899 
900  SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
901  }
#define TOOLINFO
Definition: commctrl.h:1688
LONG_PTR LPARAM
Definition: windef.h:208
#define TTF_IDISHWND
Definition: commctrl.h:1734
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define SendMessage
Definition: winuser.h:5709
#define TTM_DELTOOL
Definition: commctrl.h:1810

◆ remove() [2/2]

void ToolTip::remove ( HWND  hparent,
UINT  id 
)
inline

Definition at line 903 of file window.h.

904  {
905  TOOLINFO ti = {
906  sizeof(TOOLINFO), 0, hparent, id,
907  {0,0,0,0}, 0, 0, 0
908  };
909 
910  SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
911  }
#define TOOLINFO
Definition: commctrl.h:1688
LONG_PTR LPARAM
Definition: windef.h:208
#define SendMessage
Definition: winuser.h:5709
#define TTM_DELTOOL
Definition: commctrl.h:1810

The documentation for this struct was generated from the following files: