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

Slides:



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

1 Windows Programming CIS 577 Bruce R. Maxim UM-Dearborn.
Computer Graphics1 Windows NT Graphics Interface.
Introduction to Windows Programming. First Windows Program This program simply displays a blank window. The following code is the minimum necessary to.
Michael Donovan, River Campus Libraries – 12/03 DocuShare Overview and Training.
IN-LAB # 1 - GETTING STARTED - BUT FIRST: 1.Project ideas - watch the scope!!! 2.Check accounts 3. Either myself or the TA need to check you off BEFORE.
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)
Technology Education and Information Design Copyright 2009 MediTech NUI: New User Interface Online Training.
Win32 API Programming Event-driven, graphics oriented Example: User clicks mouse over a program’s window area (an event) -- – Windows decodes HW signals.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
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.
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.
Introduction to the Windows API n API - Application Programming Interface n an API is the software interface for things such as the OS n an API is the.
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.
Server Core is the preferred deployment configuration.
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.
To access our web services, go to……. Click on Customer Login.
GAM666 – Introduction To Game Programming You must use special libraries (aka APIs – application programming interfaces) to make something other than a.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 15: GUIs 1.
Lecture 7 Menu, controls, scroll bars. Menu Menu item sends WM_COMMAND message to the application window Menu is attached to window when the window is.
Presentation Outline Introduction Painting and Repainting GDI.
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.
GUI-Based Programming ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University.
Dialog boxes Modal and modeless dialog boxes Displaying about dialog box: case WM_COMMAND : switch (LOWORD (wParam)) { case IDM_APP_ABOUT : DialogBox (hInstance,
Quanta Confidential QUANTA WBU Study Report 1 昭正 2008/08/01.
Programming Input Devices. Getting the device state Schemes for processing input – Polling – Callbacks Ways to intercept messages from input devices –
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.
Introduction to OpenGL
Overview of Previous Lesson(s) Over View  Windows Programming  WinMain()  Where execution of the program begins and basic program initialization is.
Our good old first Win32 programme of lecture 8 #include int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
Introduction To GDI GDI Definition : It is a interface present in windows which provide function and related structures that an application can use to.
W indows Programming Lecture 08. Brief History of Win Windows is announced 1984 Work begins on Word for Windows 1.0 November 1985: Windows 1.0.
Windows Programming Lecture 14. WM_PAINT message Whenever an application receives the WM_PAINT message, whether the entire window needs repainting? WM_PAINT.
The New User Interface MEDITECH Training & Education.
Presentation Outline Introduction Painting and Repainting GDI.
Windows Programming Lecture 11
Windows Programming Lecture 10.
Chapter 8: Writing Graphical User Interfaces
Windows Programming Lecture 09.
Window.
18 & 19.
Windows Programming Model
Aspect-Oriented Programming
1. Introduction to Visual Basic
Windows Programming using Dev C++
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10.
Social Media And Global Computing Introduction to Visual Studio
The program in traditional OS
Windows Controls & Concepts
Made by Aistė Augustinaitė Software Engineering 3 group
Microsoft Windows 7 Basics
Windows Programming Lecture 12
Windows Programming Lecture 13
Otasuke GP-EX! Chapter 1 Menu Screen.
CS 1253 Visual Programming Unit I Windows Environment
Windows Programming Lecture 15
DATA EXCHANGE.
How to organize and document your classes
Graphics Laboratory Korea University
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/29.
GUI Socket Application
Microsoft Windows 7 Basics
Human and Computer Interaction (H.C.I.) &Communication Skills
Windows Operating System
Presentation transcript:

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

Dynadata Software Development with MFC Library Copyright, 2014 © DynaData S.A. 2/10

Dynadata The Window Class Every window belongs to a window class. An application must register a window class before creating any windows of that class. The window class defines most aspects of a window's appearance and behavior. Windows provides for three types of window classes: System Global Classes Application global classes Application local classes Dynadata Copyright, 2014 © DynaData S.A. 3/10

Dynadata System Global Classes Windows registers the system global classes for all applications to use. These classes contain the following familiar standard controls : Listbox,ComboBox,ScrollBar,Button,Static,Edit,and some less familiar controls. The class for menus. The class for the desktop window. The class for dialog boxes. ComboBox : The class for the drop-down list box contained in a combo box. MDIClient : The class for multiple-document interface (MDI) client windows. Windows NT™ adds the DDEMLEvent class for DDEML because the DDEML functionality has been incorporated into Windows NT USER. All Win32® applications can use system global classes, but applications cannot add or delete these classes. Dynadata Copyright, 2014 © DynaData S.A. 4/10

Application Global Classes Application global classes are registered with the CS_GLOBALCLASS style. An application global class is a class that is available to all parts of a process. An EXE or DLL can register classes that can be seen by other DLLs or EXEs within one process. If a DLL registers a class that is not an application global class, only that DLL can use the class. The same rule applies to a class registered by an EXE file that is not an application global class—the class is available only to the EXE code. Dynadata Copyright, 2014 © DynaData S.A. 5/10

Application Local Classes Win32 application local classes are the same as they were in Windows 3.1. They are the most frequently used window classes and are available only to the application or DLL that registers them. Application local classes are registered without the CS_GLOBALCLASS style. Most applications register an application local class for their main window to use. Dynadata Copyright, 2014 © DynaData S.A. 6/10

The Window Class Structure typedef struct tagWNDCLASS { UINT style; WNDPROC lpfnWndProc; int cbClsExtra; int cbWndExtra; HINSTANCE hInstance; HICON hIcon; HCURSOR hCursor; HBRUSH hbrBackground; LPCSTR lpszMenuName; LPCSTR lpszClassName; } WNDCLASS; The chief component of a window class is the window procedure, a function that receives and processes all input and requests sent to the window. Dynadata Copyright, 2014 © DynaData S.A. 7/10

The Window Class Structure Description I Field Description style Defines features such as window alignment, device context (DC) allocation, and double-click processing. lpfnWndProc Points to the window procedure that processes messages for the windows in the class. cbClsExtra Specifies the amount of extra memory, in bytes, that Windows should reserve for the class. cbWndExtra Specifies the amount of extra memory, in bytes, that Windows should reserve for each window in the class. hInstance Identifies the application or DLL that registered the class. Dynadata Copyright, 2014 © DynaData S.A. 8/10

The Window Class Structure Description II Field Description hIcon Defines the icon Windows displays when a window belonging to the class is minimized. hCursor Defines the cursor for windows belonging to the class. hbrBackground Defines the color and pattern Windows uses to fill the client area when the application opens or to paint a window belonging to the class. lpszMenuName Specifies the default menu for windows in the class that do not explicitly define menus. lpszClassName Identifies the name of the class. Dynadata Copyright, 2014 © DynaData S.A. 9/10

Dynadata The Window Procedure The window procedure that processes messages for the windows in the class: LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: // handle menu selections etc. break; case WM_PAINT: // draw our window - note: you must paint something here or not trap it! break; case WM_DESTROY: PostQuitMessage(0); break; default: // We do not want to handle this message so pass back to Window return DefWindowProc(hWnd, message, wParam, lParam); // to handle it in a default way } } Dynadata Copyright, 2014 © DynaData S.A. 10/10