看板 ott
作者 標題 Message Categories
時間 2010年01月13日 Wed. PM 04:00:04
Message Categories
Mesasge Category
Description
Windows Messages
These are standard Windows messages that
begin with the WM_ prefix, with the exception of WM_COMMAND
messages. Examples of Windows messages are WM_PAINT, which
indicates that you need to redraw the client area of a window.
Control Notification Messages
These are WM_COMMAND messages sent
from controls (such as a list box) to the window that created the
control or from a child window to a parent window. Parameters
associated with a WM_COMMAND message enable messages from the
controls in your application to be differentiated.
Command Messages
These are also WM_COMMAND messages that
originate from the user interface elements, such as menu items and
toolbar buttons. MFC defines unique identifiers for standard menu
and toolbar command messages.
The first two categories of message that you saw above, that is,
standard Windows messages and control notification messages, are
always handled by objects of classes derived from CWnd. Frame
window classes and view classes, for example, are derived from
CWnd, so they can have member functions to handle Windows messages
and control notification messages.
Handling command messages is much more flexible. Command messages
that arise from menus and toolbars can be handled in any class
that’s derived from CCmdTarget. For an SDI program, the sequence
in which classes are offered an opportunity to handle a command message is:
1. The view object
2. The document object
3. The document template object
4. The main frame window object
5. The application object
The sequence for routing a command message in an MDI program is:
1. The active view object
2. The document object associated with the active view
3. The document template object for the active document
4. The frame window object for the active view
5. The main frame window object
6. The application object
http://www.cnblogs.com/WarrenTang/archive/2008/04/23/1166994.html
--
※ 來源: DISP BBS (http://disp.twbbs.org)
※ 作者: ott 來自: 118.166.4.170 時間: 2010-01-13 16:00:04
※ 看板: ott 文章推薦值: 0 目前人氣: 0 累積人氣: 92
回列表(←)
分享