Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/19.

Slides:



Advertisements
Similar presentations
Prof. Yitzchak Rosenthal
Advertisements

Intro to Computers!.
Lesson 1 & 2 Review Lesson 1 & 2 Activities (Smart Notebook)
DEVELOPING ICT SKILLS PART -TWO
MIT-Word Lesson One Notes.
 A quantum is the amount of time a thread gets to run before Windows checks.  Length: Windows 2000 / XP: 2 clock intervals Windows Server systems: 12.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Technology Education and Information Design Copyright 2009 MediTech NUI: New User Interface Online Training.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
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.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
MIT-Word Lesson One Notes Sills—Fall Word Application MS Word 2010 is a type of Word Processor Word Processing software is designed primarily for.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
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.
Exploring Windows and Essential Computing Concepts 1 Windows Desktop u Windows Basics u Icon u Start Button u My Computer u Network Neighborhood u Recycle.
Chapter 3 The mouse and the Keyboard. Getting input from the Mouse.
Word Lesson One Notes Drennan. Word Application MS Word 2013 is a type of Word Processor Word Processing software is designed primarily for two purposes.
Threads G.Anuradha (Reference : William Stallings)
CIS111 PC Literacy Getting Started with Windows XP.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Today We Will Review: Operating Systems (Windows) (week 3 & 4) Starting up MS Windows Desktop and its contents Functions of the desktop components Brain.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
The New User Interface MEDITECH Training & Education.
Chapter 4 – Thread Concepts
Chapter 1: An Introduction to Visual Basic .NET
Excel Tutorial 8 Developing an Excel Application
Visual Basic .NET BASICS
Microsoft Visual Basic 2005: Reloaded Second Edition
Getting Started with Application Software
Processes and threads.
Exceptional Control Flow
X-term Tutorial.
Windows Programming Lecture 10.
An Introduction to Computers and Visual Basic
OPERATING SYSTEMS CS3502 Fall 2017
Interfacing.
Windows Programming Lecture 09.
Jim Fawcett Derived from a presentation by Dmitri Volper Su ‘2001
Chapter 4 – Thread Concepts
A keyboard generates two scan codes when the user types a key
Chapter 1: An Introduction to Visual Basic 2015
An Introduction to Computers and Visual Basic
Using Procedures and Exception Handling
Objectives To review concepts covered in the Windows Operating Systems units.
Windows Desktop Applications
Office 2010 and Windows 7: Essential Concepts and Skills
Event Driven Programming
Microsoft Office Illustrated Introductory, Windows XP Edition
WEB PROGRAMMING JavaScript.
Windows xp PART 1 DR.WAFAA SHRIEF.
COMMON CONTROLS A control is a child window that an application uses in conjunction with another window to enable user interaction. Controls are most often.
Isaac Gang University of Mary Hardin-Baylor
Aleph Beginning Circulation
An Introduction to Computers and Visual Basic
Courses Tab Press the Courses tab
X-term Tutorial.
Two methods to observe tutorial
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms
Creating Additional Input Items
Input and Interaction Ed Angel Professor Emeritus of Computer Science,
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/19

Dynadata System Resources The Keyboard Mouse Asynchronous interrupts (Timers) Dynadata Copyright, 2014 © DynaData S.A. 2/19

Processing Character Messages A window procedure receives a character message when the TranslateMessage() function translates a virtual-key code corresponding to a character key. The character messages are WM_CHAR, WM_DEADCHAR, WM_SYSCHAR and WM_SYSDEADCHAR. A typical window procedure ignores all character messages except WM_CHAR. The TranslateMessage() function generates a WM_CHAR message when the user presses any of the following keys: Any character key BACKSPACE ENTER (carriage return) ESC SHIFT+ENTER (linefeed) TAB Dynadata Copyright, 2014 © DynaData S.A. 3/19

The Mouse A window receives a mouse message when a mouse event occurs while the cursor is within the borders of the window, or when the window has captured the mouse. Mouse messages are divided into two groups: Client area messages Nonclient area messages. Typically, an application processes client area messages and ignores nonclient area messages. Mouse messages posted faster than a thread can process them are discarded. Only the most recent mouse message are treated. Dynadata Copyright, 2014 © DynaData S.A. 4/19

Client Area Mouse Messages I A window receives a client area mouse message when a mouse event occurs within the window's client area. The system generates a double-click message when the user clicks a mouse button twice in quick succession. An application-defined window does not, by default, receive double-click messages. Because of the system overhead involved in generating double-click messages, these messages are generated only for windows belonging to classes that have the CS_DBLCLKS class style. Dynadata Copyright, 2014 © DynaData S.A. 5/19

Client Area Mouse Messages II A double-click message is always the third message in a four-message series. The first two messages are the button-down and button-up messages generated by the first click. The second click generates the double-click message followed by another button-up message. Dynadata Copyright, 2014 © DynaData S.A. 6/19

Non Client Area Mouse Messages A window receives a nonclient area mouse message when a mouse event occurs in any part of a window except the client area. A window's nonclient area consists of its border, menu bar, title bar, scroll bar, window menu, minimize button, and maximize button. The system generates nonclient area messages primarily for its own use. There is a corresponding nonclient area mouse message for each client area mouse message. The names of these messages are similar except that the named constants for the nonclient area messages include the letters NC. Dynadata Copyright, 2014 © DynaData S.A. 7/19

The WM_NCMOUSEMOVE Message The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. nHittest = (INT) wParam; // hit-test value pts = MAKEPOINTS(lParam); // position of cursor Dynadata Copyright, 2014 © DynaData S.A. 8/19

The WM_NCHITTEST Message Whenever a mouse event occurs, the system sends a WM_NCHITTEST message to either the window that contains the cursor hot spot or the window that has captured the mouse. The system uses this message to determine whether to send a client area or nonclient area mouse message. Dynadata Copyright, 2014 © DynaData S.A. 9/19

Dynadata The HIT codes I Value Location of hot spot HTBORDER In the border of a window that does not have a sizing border. HTBOTTOM In the lower-horizontal border of a window. HTBOTTOMLEFT In the lower-left corner of a window border. HTBOTTOMRIGHT In the lower-right corner of a window border. HTCAPTION In a title bar. HTCLIENT In a client area. HTCLOSE In a Close button. HTERROR On the screen background or on a dividing line between windows (same as HTNOWHERE, except that the DefWindowProc function produces a system beep to indicate an error). Dynadata Copyright, 2014 © DynaData S.A. 10/19

Dynadata The HIT codes II Value Location of hot spot HTGROWBOX In a size box (same as HTSIZE). HTHELP In a Help button. HTHSCROLL In a horizontal scroll bar. HTLEFT In the left border of a window. HTMENU In a menu. HTMAXBUTTON In a Maximize button. HTMINBUTTON In a Minimize button. HTNOWHERE On the screen background or on a dividing line between windows. Dynadata Copyright, 2014 © DynaData S.A. 11/19

Dynadata The HIT codes III Value Location of hot spot HTREDUCE In a Minimize button. HTRIGHT In the right border of a window. HTSIZE In a size box (same as HTGROWBOX). HTSYSMENU In a System menu or in a Close button in a child window. HTTOP In the upper-horizontal border of a window. HTTOPLEFT In the upper-left corner of a window border. HTTOPRIGHT In the upper-right corner of a window border. HTTRANSPARENT In a window currently covered by another window in the same thread. HTVSCROLL In the vertical scroll bar. HTZOOM In a Maximize button. Dynadata Copyright, 2014 © DynaData S.A. 12/19

Dynadata Capturing the Mouse The system posts a mouse message to the window that contains the cursor hot spot when a mouse event occurs An application can change this behavior by using the SetCapture() function to route mouse messages to a specific window. The window receives all mouse messages until the application calls the ReleaseCapture() function or specifies another capture window, or until the user clicks a window created by another thread. Dynadata Copyright, 2014 © DynaData S.A. 13/19

Timers I Windows timers create an event that periodically triggers a specific action in an application. The event can be a WM_TIMER message returned from a GetMessage or a PeekMessage function, or it can be a call to a specified TimerProc callback function. When you specify a TimerProc callback function, the DispatchMessage function simply calls the callback function instead of the window procedure. Dynadata Copyright, 2014 © DynaData S.A. 14/19

Timers II The interrupt occurs approximately once every 55 milliseconds. The WM_TIMER message is a low-priority message. The GetMessage and PeekMessage functions retrieve this message only when no other higher-priority messages are in the thread’s message queue. Timers are a limited resource. If all timers are in use, the SetTimer function fails. Unless keeping a timer active is absolutely essential to a program, the application must destroy the timer when it is not in use. Dynadata Copyright, 2014 © DynaData S.A. 15/19

Dynadata Multimedia Timers Multimedia timer services allow applications to schedule timer events with the greatest resolution (or accuracy) possible for the hardware platform. These multimedia timer services allow you to schedule timer events at a higher resolution than other timer services. The timeSetEvent function starts a specified timer event. The multimedia timer runs in its own thread. After the event is activated, it calls the specified callback function or sets or pulses the specified event object. Dynadata Copyright, 2014 © DynaData S.A. 16/19

Dynadata Wait functions The Win32® API provides a set of wait functions to allow a thread to block its own execution. The wait functions do not return until the specified criteria have been met. The type of wait function determines the set of criteria used. When a wait function is called, it checks whether the wait criteria have been met. If the criteria have not been met, the calling thread enters an efficient wait state, consuming very little processor time while waiting for the criteria to be met. Dynadata Copyright, 2014 © DynaData S.A. 17/19

Dynadata Wait functions There are four types of wait functions : Single-object Multiple-object Alertable (return also if the system queues an I/O completion ) Registered (wait operation is performed by a thread from the thread pool) Dynadata Copyright, 2014 © DynaData S.A. 18/19

Dynadata Waitable Timer Object A "waitable" timer object is a synchronization object whose state is set to signaled when the specified due time arrives. There are two types of waitable timers that can be created: manual-reset (state remains signaled until SetWaitableTimer function) synchronization (The state remains signaled until a thread completes a wait operation on the timer object) A timer of either type can also be a periodic timer. Dynadata Copyright, 2014 © DynaData S.A. 19/19