有本书《Inside COM》好象讲了
解决方案 »
- map这样用行不
- 简历里面熟悉MFC编程应该怎么写?
- 关于MFC设计UI方面的问题
- COleDateTime和CTime我现在在做的过程中发现用CTime没什么问题,而用COleDateTime却出现问题了。这是为什么,是不是COleDateTime是一个控
- 类之间的通信,调用变量问题.
- 怎么样实现把整个屏幕左右翻转的效果呢````急
- VC中,SetTimer(40*60000, 1, NULL),如何暂停计时?
- MFC是不是对多线程的支持有问题?不知道有没有人遇到和我一样的问题
- 弱问题:子网掩码为255.255.0.0,其广播地址为哪个?我想对192.168.100及192.168.101等网段进行广播
- 谁知道MFC入门学习最佳书籍吗?
- 串口监控程序中的一个问题???
- 有没有wininet api能获得网页更新时间?
To enable us to process window messages in a CWindowImpl-derived class, ATL inherits from the abstract base class CMessageMap. CMessageMap declares one pure virtual function, ProcessWindowMessage. The entire class is shown here: class ATL_NO_VTABLE CMessageMap
{
public:
virtual BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam,
LRESULT& lResult, DWORD dwMsgMapID) = 0;
};
Your CWindowImpl-derived class must implement the ProcessWindowMessage function, which is called from the WindowProc function in the CWindowImpl base class CWindowImplBaseT. If ProcessWindowMessage returns TRUE, the message has been handled by your derived class and WindowProc shouldn't continue with default message processing. A FALSE return value allows default processing.BEGIN_MSG_MAP(CMainFrame)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
END_MSG_MAP()Message handlers are processed in order from top to bottom until something handles the message or processing falls through, which results in default processing. The bHandled parameter is set to TRUE by default before the handler function is called. You can manually set it to FALSE (as OnDestroy does) to allow default processing after the handler function returns and ProcessWindowMessage exits.ATL has a large selection of message-handler macros to choose from. The basic types are MESSAGE_HANDLER, NOTIFY_HANDLER, and COMMAND_HANDLER for normal window messages, WM_NOTIFY messages, and WM_COMMAND messages. Ranges of messages are handled using the corresponding macros MESSAGE_RANGE_HANDLER, NOTIFY_RANGE_HANDLER, and COMMAND_RANGE_HANDLER. The easiest way to add handlers to a message map is to right-click on the class in ClassView and choose Add Windows Message Handler from the context menu. Microsoft Visual C++ then inserts the correct macro based on the message you choose to handle. You can't use ClassWizard to add handlers to ATL message maps. Here's a summary of the available message-handler macros:
MESSAGE_HANDLER Maps a window message to a handler function
MESSAGE_RANGE_HANDLER Maps a contiguous range of window messages to a handler function
COMMAND_HANDLER Maps a WM_COMMAND message to a handler function based on the notification code and the identifier of the menu item, control, or accelerator
COMMAND_ID_HANDLER Maps a WM_COMMAND message to a handler function based on the identifier of the menu item, control, or accelerator
COMMAND_CODE_HANDLER Maps a WM_COMMAND message to a handler function based on the notification code
COMMAND_RANGE_HANDLER Maps a contiguous range of WM_COMMAND messages to a handler function based on the identifier of the menu item, control, or accelerator
NOTIFY_HANDLER Maps a WM_NOTIFY message to a handler function based on the notification code and the control identifier
NOTIFY_ID_HANDLER Maps a WM_NOTIFY message to a handler function based on the control identifier
NOTIFY_CODE_HANDLER Maps a WM_NOTIFY message to a handler function based on the notification code
NOTIFY_RANGE_HANDLER Maps a contiguous range of WM_NOTIFY messages to a handler function based on the control identifier