Lecture Two Event Handling Keyboard and Mouse Input.

Slides:



Advertisements
Similar presentations
Fall 2007ACS-1805 Ron McFadyen1 Chapter 5 Interactive Programs.
Advertisements

The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Simple Gui in C++. Project Selecting So Far Registering the window class Creating the window.
First Windows Program Hello Windows. 2 HELLOWIN.C #include LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; int WINAPI WinMain (HINSTANCE hInstance,
Intro to Windows Programming Basic Ideas. Program Entry Point Int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
Introduction to Microsoft Windows MFC Programming: the Application/Window Approach Lecture 4.
Week 3 C For Win Lecture :.  Mouse Message  Keyboard Message.
Bertrand Bellenot ROOT Users Workshop Mar ROOT GUI Builder Status & Plans ROOT & External GUI World MFC, FOX, Qt, PVSS… Snapshot of the Future.
Building an MFC Application Using the Wizard. Terms Solution – A container for related projects – An executable or DLL – May be constructed from multiple.
Visual C++ Lecture 11 Friday, 29 Aug Windows Graphic User Interface l Event driven programming environment l Windows graphic libraries (X11 on Unix,
Prepared by Fareeha Lecturer DCS IIUI 1 Windows API.
Overview of Previous Lesson(s) Over View  Visual C++ provides us with 3 basic ways of creating an interactive Windows application  Using the Windows.
Dr Dat Tran - Week 4 Lecture Notes 1 ToolStrip Programming Graphical User Interfaces PG (7110) University of Canberra School of Information Sciences &
Chapter 1: Hello, MFC Windows Programming Model Department of Digital Contents Sang Il Park.
Chapter 1: Hello, MFC Your first MFC Application Department of Digital Contents Sang Il Park.
G RAPHICAL U SER I NTERFACE C ONCEPTS : P ART 1 1 Outline Introduction Windows Forms Event-Handling Model - Basic Event Handling.
Classic Controls Trần Anh Tuấn A. Week 1 How to create a MFC project in VS 6.0 How to create a MFC project in VS 6.0 Introduction to Classic Controls.
Microsoft Foundation Classes. What is MFC? Set of C++ classes written by MS Simplifies writing complex programs Covers many areas: – GUI – I/O – O/S interfaces.
Lab 6: event & input intro User Interface Lab: GUI Lab Oct. 2 nd, 2013.
Further games and graphics concepts COSE50581 Introduction to Module and Recap Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
BZUPAGES.COM Visual Programming Lecture – 2 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan.
Direct3D Workshop November 17, 2005 Workshop by Geoff Cagle Presented by Players 2 Professionals.
Chapter 3 The mouse and the Keyboard. Getting input from the Mouse.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Chapter2: Drawing a Window. Review: Introducing MFC.
CSE 381 – Advanced Game Programming User Interface & Game Events Management.
11 General Game Programming Approach. The program is event-driven The program is event-driven –Messages = events –So as all windows system (for example.
Dialog boxes Modal and modeless dialog boxes Displaying about dialog box: case WM_COMMAND : switch (LOWORD (wParam)) { case IDM_APP_ABOUT : DialogBox (hInstance,
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Event Handling Tonga Institute of Higher Education.
Programming Input Devices. Getting the device state Schemes for processing input – Polling – Callbacks Ways to intercept messages from input devices –
Chapter 7 Controls. 2 Introduction (1/4) Control –Special kind of window –Designed to convey information to the user or to acquire input –Reduce the tedium.
The WM_NCHITTEST Message  This is an internal message used by Windows for generating all the other mouse messages.  Though it almost never needs to be.
Menus  Menus is a feature which is common to almost every windows applications. It is the one of the most common user interface elements around.  Windows.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
Implement User Input Windows Development Fundamentals LESSON 2.4A.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Our good old first Win32 programme of lecture 8 #include int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
Chapter 3 Keyboard Input Department of Digital Contents Sang Il Park.
THE MOUSE Left Click THE MOUSE Right Click.
Steps to Build Frame Window Recipe Application
Introduction to Event-Driven Programming
Event-driven programming
Windows Programming Lecture 09.
Jim Fawcett Derived from a presentation by Dmitri Volper Su ‘2001
Windows Programming Model
Summer 2001 James Amyot Robert Gowans
MFC Dialog Application
Lesson 1: Buttons and Events – 12/18
Event Driven Programming
DEBUGGING.
Predefined Dialog Boxes
Queued and Nonqueued Messages
Custom dialog boxes Unit objectives
Conditionally Confirming a Submit
Windows Programming Lecture 12
Visual programming Chapter 2: Events and Event Handling
Building a Win32API Application
Windows Programming Lecture 15
Web Design and Development
Event Driven Programming Anatomy – Handle
19.
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10.
Lecture 5 Menu Strip Demo with Dialog Controls.
The monitor shows information.
Graphics Laboratory Korea University
Steps to Build Frame Window Recipe Application
GUI Socket Application
Message Mapping Mechanisms in MFC and Other Applications in Visual C++
Presentation transcript:

Lecture Two Event Handling Keyboard and Mouse Input

Contents  Debug Technique  Message Mapping in MFC  Keyboard Msg  Mouse Msg  Other MSGs  MessageBox

Debug Technique  BreakPoint  afxDump  TRACE  Debug Window

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

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)

Mouse Msg  Mouse Event  Mouse click, movement  Mouse wheel  SetCapture, ReleaseCapture

Other MSGs  WM_PAINT  WM_TIMER  WM_SIZE  WM_CREATE  WM_DESTROY

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 );