Tech Tips
By Edited by Chris Branch, May 01, 2002
Size Limitations for Device-Dependent Bitmaps - Stephen Schumacher
The ability to create large bitmaps in your app will vary with each machine it runs on. Here are some tips to reduce the limitations.
Custom Keyboard Navigation with Radio Buttons - Matthew Wilson
In some situations, such as web-page style windows or embedded dialogs, the default keyboard handling may not be enough. This solution helps provide the right user feedback for radio button navigation.
Using Resources in MFC Extension DLLs - Thomas Gawehns
Here's a class to manipulate the global module handle that MFC uses to retrieve resources. This lets you avoid trouble if your resource IDs overlap with IDs used by other extension DLLs.
An Easy Way to Add Tool Tips to Any MFC Control - Zuoliu Ding
A parent window may not intercept the WM_MOUSEMOVE message for a child control because the child window eats this message without routing it to the parent. If you want to add tool tips for each control in a child window, the helper class CTipHelper presented here will forward WM_MOUSEMOVE messages on to its parent.
May 2002/Tech Tips
Listing 3: tiphlpr.h
Helper class for using generic tool tips
/*---------------------------------------------------------------
TipHlpr.h: The helper window class CTipHelper and macros
Author: Zuoliu Ding
---------------------------------------------------------------*/
#ifndef _TIPHELPER_H__0A0888A8
#define _TIPHELPER_H__0A0888A8
class CTipHelper : public CWnd
{
protected:
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CTipHelper, CWnd)
ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()
void CTipHelper::OnMouseMove(UINT nFlags, CPoint point)
{
MapWindowPoints(GetParent(), &point, 1);
GetParent()->SendMessage(WM_MOUSEMOVE, nFlags,
MAKELONG(point.x, point.y));
}
#define SET_TIP_TEXT(tip, ID, text) \
if (! ##tip.SetTipText(text, GetDlgItem(ID)))
#define END_TIP_TEXT(tip) \
{##tip.CancelTipWnd();}
#endif // _TIPHELPER_H__0A0888A8