Download presentation
Presentation is loading. Please wait.
Published byMaria Stafford Modified over 9 years ago
1
Lecture Two Event Handling Keyboard and Mouse Input
2
Contents Debug Technique Message Mapping in MFC Keyboard Msg Mouse Msg Other MSGs MessageBox
3
Debug Technique BreakPoint afxDump TRACE Debug Window
4
Message Mapping in MFC Detects event Determines which window get that event OS calls WndProc WndProc determines type of event/message Function in turn takes care of the event
5
Keyboard Msg Handle all Keyboard event Method to add event handler for a window OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
6
Mouse Msg Mouse Event Mouse click, movement Mouse wheel SetCapture, ReleaseCapture
7
Other MSGs WM_PAINT WM_TIMER WM_SIZE WM_CREATE WM_DESTROY
8
MessageBox Small Dialog Box notify user simple message AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 ); int CWnd::MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK );
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.