INFO: Dynamic Processing of WM_COMMAND Messages (97693)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++ for Windows, 16-bit edition 1.51
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q97693 SUMMARY
The message-map mechanism provided by the Microsoft Foundation Classes
(MFC) can process WM_COMMAND messages for a constant ID. However, in some
cases, an application needs to process WM_COMMAND messages for an ID that
is not known until run time. This can occur when an application modifies
menus or dynamically creates controls at run time. To process these
messages, your application must override the CCmdTarget::OnCmdMsg()
function.
REFERENCES
MFC Technical Note 6: Message Maps.
MFC Technical Note 21: Command and Message Routing.
Modification Type: | Major | Last Reviewed: | 12/11/2003 |
---|
Keywords: | kbArchitecture kbDocView kbinfo KB97693 |
---|
|