Article ID: 183528
Article Last Modified on 12/1/2003
APPLIES TO
- The ClassWizard, when used with:
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q183528
SYMPTOMS
When you double-click a Scroll Bar or custom control in the Visual C++
Dialog editor, the New Windows Message and Event Handlers dialog box
appears. However, no events are displayed for the control.
On the Message Maps tab of the MFC ClassWizard dialog box, select a dialog
class. The Messages list is blank for Object IDs corresponding to a Scroll
Bar or custom control.
CAUSE
The Scroll Bar and custom controls do not send notification messages so the
MFC ClassWizard cannot list any messages to map.
RESOLUTION
Use the ClassWizard, as follows, to add WM_HSCROLL or WM_VSCROLL message
handlers to the class of the parent window that hosts the Scroll Bar
control:
- Press CTRL+W to open the MFC ClassWizard.
- On the Message Maps tab, select the dialog class in the Class name box.
- In the Object IDs list box, select the dialog class.
- In the Messages list box, select WM_HSCROLL or WM_VSCROLL, then click
Add Function.
For the user-defined messages of a custom control, or the
WM_CTLCOLORSCROLLBAR message, manually add message handlers to the parent
window's class. For additional information, please see the following
article in the Microsoft Knowledge Base:
99848 Use ON_MESSAGE() Macro to Map Less-Common Messages
STATUS
This behavior is by design.
REFERENCES
Visual C++ Online Books; search on "Scroll Bar Messages"
Platform, SDK, and DDK Documentation: Platform SDK; User Interface
Services; Controls; Scroll Bars; Scroll Bar Reference; Scroll Bar Messages
Keywords: kbide kbprb kbwizard KB183528