Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


Use this macro to map a contiguous range of control IDs to a single message handler function for a specified Windows notification message, such as BN_CLICKED.

ON_CONTROL_RANGE(wNotifyCode, id1, id2, memberFxn )



The notification code to which your handler is responding.


Command ID at the beginning of a contiguous range of control IDs.


Command ID at the end of a contiguous range of control IDs.


The name of the message-handler function to which the controls are mapped.

The range of IDs starts with id1 and ends with id2. The handler is called for the specified notification coming from any of the mapped controls.

There is no automatic support for message map ranges, so you must place the macro yourself.

For more information on implementing handler functions for a range of control IDs, refer to Handlers for Message-Map Ranges.

Community Additions

© 2015 Microsoft