C++博客 联系 聚合 管理  

Blog Stats

文章分类(17)

收藏夹(2)

文章档案(18)

相册

Blogs

citywanderer

There are three main categories:
1、Command message:
This includes WM_COMMAND notification messages from user-interface objects: menus, toolbar buttons, and accelerator keys.(digested from msdn)
for example:
 Add click event handler to menuitem about, the MFC generate automatically three lines code( macro definition: ON_COMMAND(ID_HELP_ABOUT, OnAbout) in .cpp file , event handle function: void CCapturePacketDlg::OnAbout()  in .cpp file, and event handle function's declaration: void OnAbout() in .h file), the macro ON_COMMAND(ID_HELP_ABOUT, OnAbout) depresent:  { WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSigCmd_v, static_cast<AFX_PMSG> (memberFxn) }, among therm, WM_COMMAND is message id, and is also Command message.
2、Windows messages
This includes primarily those messages beginning with the WM_ prefix, except for WM_COMMAND. Windows messages are handled by windows and views. These messages often have parameters that are used in determining how to handle the message.(digested by msdn)
for example:
Add event handle function OnHotkey() witch responds to Alt + F5 to show or hide the main window. I don't kown how use MFC to add the event code automatically, so i add code into three places( macro definition: ON_MESSAGE(WM_HOTKEY, OnHotkey) in .cpp file , event handle function: LRESULT CCapturePacketDlg::OnHotkey(WPARAM wp,LPARAM lp) in .cpp file, and event handle function's declaration: LRESULT OnHotkey(WPARAM wp,LPARAM lp) in .h file). But how does the application responde to Alt + F5? we must register the hot key, so i can call API RegisterHotKey in my dialog class's OnInitDialog function.
3、Control notifications
Sorry, so far, i have used it.

posted on 2006-06-18 14:19 citywanderer 阅读(378) 评论(0)  编辑 收藏 引用 所属分类: C++

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理