ReactOS 0.4.15-dev-7674-gc0b4db1
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}
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define WS_EX_NOPARENTNOTIFY
Definition: pedump.c:646
#define WS_POPUP
Definition: pedump.c:616
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define TOOLTIPS_CLASS
Definition: commctrl.h:1710
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TTS_NOPREFIX
Definition: commctrl.h:1758
HINSTANCE _hInstance
Definition: globals.h:270
WindowHandle super
Definition: window.h:852
void activate(BOOL active=TRUE)
Definition: window.h:856
#define CreateWindowEx
Definition: winuser.h:5754
#define CW_USEDEFAULT
Definition: winuser.h:225

Member Function Documentation

◆ activate()

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

Definition at line 856 of file window.h.

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

Referenced by ToolTip().

◆ 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.

862 {
863 TOOLINFO ti = {
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 }
@ lparam
Definition: SystemMenu.c:31
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define TTM_ADDTOOLA
Definition: commctrl.h:1786
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TTF_SUBCLASS
Definition: commctrl.h:1767
#define TTM_ADDTOOLW
Definition: commctrl.h:1787
#define TTF_TRANSPARENT
Definition: commctrl.h:1770
#define TOOLINFO
Definition: commctrl.h:1718
LONG_PTR LPARAM
Definition: windef.h:208
CHAR * LPTSTR
Definition: xmlstorage.h:192

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

◆ 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 }
& rect
Definition: startmenu.cpp:1413

◆ remove() [1/2]

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

Definition at line 893 of file window.h.

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 TTM_DELTOOL
Definition: commctrl.h:1840

Referenced by NotifyArea::UpdateIcons().

◆ 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 }

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