【正文】
MyCommandEx(UINT nID)。控件發(fā)送給父窗體的通知消息ON_CONTROL(wNotificationCode, id, fx)eg:處理按鈕的按下ON_BN_CLICKED(IDC_BUTTON_DEFAULTSETTINGS, CCommPropertyDlg::OnBnClickedButtonDefaultsettings)與下面語句是等同的ON_CONTROL(BN_CLICKED, IDC_BUTTON_DEFAULTSETTINGS, CCommPropertyDlg::OnBnClickedButtonDefaultsettings)SDK的做法是SendMessage WM_COMMAND 給父窗體,控件ID和信息包含在WPARAM,LPARAM 中。WM_NOTIFYON_NOTIFY() 一個更高級的消息,提供更多的信息。WPARAM contain the control IDLPARAM contain a point to NMHDR struct or some large struct that has an NMHDR struct as its first member.3)message reflectionA control send notify message to his parent window, and his parent resend the message to the code reusage purpose.Eg:1)CYellowEdit—WM_CTLCOLOR演試CYellowEdit 處理WM_CTLCOLOR 和父窗體處理WM_CTLCOLOR.2)自定義消息1)DIALOG的運行過程m_pMainWndtheApp如何修改及處理SystemMenu。如何替換主對話框消息映射和數(shù)據(jù)交換CWinAppCWnd2)SDICFrameWnd,CView,CDocument之間的關(guān)系((CMyDoc *)((CMainFrame *)AfxGetMainWnd())GetActiveDocument())((CMainFrame *)((CMainFrame *)AfxGetMainWnd())GetActiveFrame())((CMyView *)((CMainFrame *)AfxGetMainWnd())GetActiveView())((CMainFrame *)((CMainFrame *)AfxGetMainWnd())GetActiveWindow())((CMyApp *)AfxGetApp())CFrameWnd 元素CStautsBarCtoolBarCMenu作業(yè):1)不用IDE的功能自己動手作出Dlg/SDI(CFramwWnd Cview)筐架2)并加上CMenu,CToolBar,CStatusBar(要有實際功能),類及控件的介紹Ctime/CTimeSpanCString(Multi byte char, Wide char, Unicode)CArray(數(shù)組操作)Simple value types(CFileTime, CPoint, CSize)CFile文件操作目錄操作注冊表操作GetPrivateProfileString/WritePrivateProfileString各種常用控件(CEdit, CButton, CStatic, CComboBox, CListCtrl, ......)控件在Win32編程中的使用.CToolBarCStatusBarCPropertySheetCPropertyPage Class(圖形設(shè)備環(huán)境)作業(yè):綜合以上功能用MFC實現(xiàn)一個應(yīng)用。(互斥體,事件,信號量,臨界區(qū))(MDI)的研究參考書Win32編程Windows核心編程MFC編程Programming Windows With MFC Second Editionjeff prosise深入淺出MFC編程侯捷C++語言:thinking in C++Effective C++Scoot Meyers