ToolTipExtender Class Reference

ToolTipExtender Class Reference

#include <winutil.h>

Class Description

Internal use only. Hidden internal implementation for ToolTipExtender.

See also
Class ToolTipExtender.

Description:
This class allows a developer to add tooltips to one or more window controls. Controls of all types are supported. One extender object can support all tooltips for a dialog, it's not necessary to create one extender per tooltip. This is useful for control types which do not have native tooltip support.
+ Inheritance diagram for ToolTipExtender:

Public Member Functions

CoreExport ToolTipExtender ()
 Class constructor. More...
 
virtual CoreExport ~ToolTipExtender ()
 Class destructor. More...
 
virtual CoreExport void SetToolTip (HWND hWnd, const MSTR &toolTipIn)
 Sets a tooltip for an arbitrary UI control. More...
 
virtual CoreExport void GetToolTip (HWND hWnd, MSTR &toolTipOut)
 Gets the tooltip for an arbitrary UI control. More...
 
virtual CoreExport void RemoveToolTip (HWND hWnd)
 Removes the tooltip from an arbitrary UI control. More...
 
virtual CoreExport void RemoveToolTips ()
 Removes all tooltips and releases heap memory. More...
 
virtual CoreExport HWND GetToolTipHWND ()
 Returns a handle to the operating system's ToolTip object. More...
 

Protected Attributes

ToolTipExtenderImpl * impl
 Internal use only. This implementation object is created when the first tooltip is set. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

Class constructor.

No heap memory is allocated until tooltips are actually set.

virtual CoreExport ~ToolTipExtender ( )
virtual

Class destructor.

Removes all tooltips and releases heap memory.

Member Function Documentation

virtual CoreExport void SetToolTip ( HWND  hWnd,
const MSTR toolTipIn 
)
virtual

Sets a tooltip for an arbitrary UI control.

Calling this twice for a single control is safe, and will remove the first tooltip. Calling this for multiple controls is allowed, as this class supports an unlimited number of tooltips. Note that tooltip resources are not automatically freed when a control is destroyed. Resources are freed when the extender is destroyed, or by calling RemoveToolTip() or Reset().

Parameters
hWndHandle to the window control.
toolTipInToolTip string. The string is copied, so the caller may safely delete this.
virtual CoreExport void GetToolTip ( HWND  hWnd,
MSTR toolTipOut 
)
virtual

Gets the tooltip for an arbitrary UI control.

This only functions for tooltips set with this class. Returns an empty string if no tooltip is set.

Parameters
hWndHandle to the window control.
toolTipOutToolTipOutput string. The method will resize the string as necessary.
virtual CoreExport void RemoveToolTip ( HWND  hWnd)
virtual

Removes the tooltip from an arbitrary UI control.

This only functions for tooltips set with this class. Note that tooltip resources are not automatically freed when a control is destroyed. Resources are freed when the extender is destroyed, or by calling this function or Reset().

Parameters
hWndHandle to the window control.
virtual CoreExport void RemoveToolTips ( )
virtual

Removes all tooltips and releases heap memory.

virtual CoreExport HWND GetToolTipHWND ( )
virtual

Returns a handle to the operating system's ToolTip object.

This provides access to extended tooltip functionality. See the operating system's documentation for TOOLTIPS_CLASS.

Member Data Documentation

ToolTipExtenderImpl* impl
protected

Internal use only. This implementation object is created when the first tooltip is set.