Registering a window class Windows allows many styles of window to be created. To tell Windows to create a window as you want it you need to define a class.

Slides:



Advertisements
Similar presentations
Prof. Muhammad Saeed. Procedure-Driven Programming Event-Driven Programming Events Messages Event Handlers GUI Windows and Multitasking Queues ( System.
Advertisements

Basic Computer Skills Windows & the Internet.
Introduction to the Mac user-interface The Mac user interface is subtly different from the Microsoft Windows interface So we will spend a few minutes pointing.
Intro to Computers!.
Windows Basics An Introduction to the Windows Operating System.
Human Computer Interface
Microsoft Office 2007-Illustrated Introductory, Windows Vista Edition Windows XP Unit A.
CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
Introduction to Windows Programming. First Windows Program This program simply displays a blank window. The following code is the minimum necessary to.
COMPREHENSIVE Windows Tutorial 3 Personalizing Your Windows Environment.
® Microsoft Office 2010 Exploring the Basics of Microsoft Windows 7.
CGS 1060 Introduction to MicroComputer Usage Chapter 1 Windows 7
XP Exploring the Basics of Microsoft Windows XP1 Exploring the Basics of Windows XP.
FIRST COURSE Getting Started with Microsoft Office 2007.
Interaction Styles Interface Widgets. What are Interaction Styles?  A Collection of interface objects and associated techniques from which an interaction.
FIRST COURSE Getting Started with Microsoft Office 2007.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Return to the Office 2007 web page Lesson 2: Working with Windows Programs.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
PowerPoint Add formulae. Course contents Overview: Typing math formulae Lesson1: Type a simple formula Lesson2: Type a complex formula.
Exploring the Basics of Windows XP
Lesson 9 Windows Management
Ch 26 & 27 User Interfaces.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Introduction to PowerPoint 2003 Learning And Research Technical Unit (LARTU)
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
How to use the internet The internet is a wide ranging network that thousands of people use everyday. It is a useful tool in modern society that once one.
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.
App Inventor MIT App Inventor.
The Fundamentals of Using Windows 95. Windows 95 ã operating system that performs every function necessary for the user to communicate and control computer.
Introduction To Microsoft Word C Apply intermediate skills in utilizing word processing software Word processing programs make the writing process.
1 After completing this lesson, you will be able to: Start Word. Explore the Word window. Enter text in a document. Save a document. Close a document and.
BZUPAGES.COM Visual Programming Lecture – 2 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan.
XP New Perspectives on Microsoft Windows 2000 Professional Windows 2000 Tutorial 1 1 Microsoft Windows 2000 Professional Tutorial 1 – Exploring the Basics.
CS350 – Windows Programming Formerly and more properly named: Event Driven Programming Dr. Randy Ribler.
A guide to creating a power point display Essentials Ctl M =New Slide: a new slide can be inserted. It is placed after the slide that you are viewing.
Learning PowerPoint Part One: Working With Words Directions: Click the slide icon in the section at the right to move on to the next slide.
Computer Basics Lesson 2 Using Windows and the Start Menu 1.
FIRST COURSE Getting Started with Microsoft Office 2007 COM111 Introduction to Computer Applications.
® Microsoft Office 2010 Exploring the Basics of Microsoft Windows 7.
Build-A-Button Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, October 8, 2003.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Microsoft Office 2010 is the newest version of Microsoft Office, offering features that provide users with better functionality and easier ways to work.
1 Introduction to Microsoft Windows Lecture Outline.
CHAPTER 7 Exploring Microsoft Windows 7. Learning Objectives Identify the parts of the Windows 7 desktop Use common Windows elements Navigate Windows.
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.
What’s on Your Desktop?. Programs on your computer Some programs are standard on most computers for example: Microsoft Word Internet Explorer Microsoft.
Overview of Previous Lesson(s) Over View  Windows Programming  WinMain()  Where execution of the program begins and basic program initialization is.
Introduction to Layers GIMP User Manual. What is a Layer? Every image in GIMP is made by combining one or more images called Layers laid on top of each.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Word & Windows Terminology Review. 1. Provides one-click access to common commands you use frequently. In the Business Lab some of the commands you will.
You can create cloze worksheets, print them out and give the to the students to fill in. You can display the worksheet on the data-projector and correct.
Day 11 Review. Where would I click to send an ?
COMPREHENSIVE Getting Started with Microsoft Office 2007.
Windows Tutorial 3 Personalizing Your Windows Environment
Getting Started with Microsoft Office 2007
Chapter 2: The Visual Studio .NET Development Environment
Scratch for Interactivity
Windows Programming Lecture 09.
Window.
Exploring the Basics of Windows XP
Microsoft Windows 7 Basics
New Perspectives on Windows XP
Review: Applying Computer Basics
Chapter 1: Digital Communication Tools
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10.
An Introduction to the Windows Operating System
Presentation transcript:

Registering a window class Windows allows many styles of window to be created. To tell Windows to create a window as you want it you need to define a class of window and register it with windows. In order to register a class you call the API function: ATOM RegisterClassEx(CONST WNDLCASSEX *lpwcx); This function takes a pointer to a structure you have defined to describe your window class. The return value ATOM is one of those Microsoft typedefs again and resolves to unsigned short. This function returns 0 if there was an error. The const indicates that the function will not change the structure.

style - this allows us to combine some flags to describe the low level style for our window, CS_HREDRAW means we want our window redrawing if the width is ever changed. lpfnWindProc - this is essential, this is where we tell Windows which of our functions is going to handle messages sent to this window. Remember from earlier that Windows is event driven, so if someone clicks on the window Windows responds to that even by telling us what has happened. We provide a function to receive these messages and in this structure element we pass the pointer to the function (a callback function). The WNDPROC is used to cast the function pointer into the correct form for Windows. hIcon and hIconSm - defines the icons used by the program. The small one (16 by 16) is displayed in the top left of the window and on the taskbar. The big one (32 by 32) is visible when you look at the executable in explorer on your hard drive and also when you ALT-TAB between applications. These icons are defined using the resource editor,described elsewhere, and referred to using a #define. hCursor - this describes the default mouse cursor displayed whenever the mouse is over this window. Usually this is an arrow (IDC_ARROW) but you can also have things like IDC_CROSS or IDC_WAIT (the hourglass) or even define your own. hBrBackground - the colour you want the background of your window to be. By using COLOR_WINDOW+1 we are saying we want to use whatever background the user of the PC has defined. If we wanted to use a basic colour we need to define a brush or use one of the stock brushes. e.g. to set the background to black we could use: hBrBackground=(HBRUSH) GetStockObject(BLACK_BRUSH); Note that if you are drawing the whole screen yourself you are better to leave this as 0 which means Windows will not fill the background.brush lpszMenuName - the menu you want to be displayed in this window. Again you define this in the resource editor and give it an identifier or 0 if no menu used. lpszClassName - this is essential, this is your name you want to give to this class, it can be anything you want.