Basic Data Types. typedef short SHORT; typedef unsigned long DWORD;

Similar documents
CS222: Systems Programming

Application Power Management for Mobility

Pemrograman Dasar. Basic Elements Of Java

Programming languages C

Mouse and Pointer Settings. Technical Brief

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

Integrating Gestures in Windows Embedded Compact 7. Douglas Boling Boling Consulting Inc.

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window)

How To Write Portable Programs In C

AODA Mouse Pointer Visibility

CryptoAPI. Labs. Daniil Leksin

What is COM/DCOM. Distributed Object Systems 4 COM/DCOM. COM vs Corba 1. COM vs. Corba 2. Multiple inheritance vs multiple interfaces

Mouse Programming Mouse Interrupts Useful Mouse functions Mouselib.h Mouselib.c

ASUS GPU Tweak User Manual

Cherokee Language Technology Program - Education Services

Computer Basics: Tackling the mouse, keyboard, and using Windows

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

Xerox Standing Accounting: Tracking Color Usage Only Customer Tip

Sources: On the Web: Slides will be available on:

Number Representation

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

White Paper. Guidelines for Developing Windows Applications Compatible with Dragon NaturallySpeaking and Dragon Medical

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

Help on the Embedded Software Block

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

Visual Basic Programming. An Introduction

Printers connected to a computer running GARO printer driver and Windows OS (2000, XP, 2003 Server, Vista 32/64-bit)

How to set up a database in Microsoft Access

Select Correct USB Driver

First Bytes Programming Lab 2

Virtuozzo Virtualization SDK

1 Abstract Data Types Information Hiding

An Overview of Java. overview-1

Software Application Development. D2XX Programmer's Guide

Setting up VPN and Remote Desktop for Home Use

Introduction to LogixPro - Lab

Wireless Presentation Adaptor User s Manual

HP LASER GAMING MOUSE USER MANUAL

Faculty of Engineering Student Number:

MANAGING PRINT SERVER DEVICES WITH "WINDOWS XP" VIRTUAL MACHINES

Operating Systems. and Windows

Setting up VPN and Remote Desktop for Home Use

Evoluent Mouse Manager for Windows. Download the free driver at evoluent.com. The primary benefits of the Mouse Manager are:

13-1. This chapter explains how to use different objects.

Fast Arithmetic Coding (FastAC) Implementations

8. MACROS, Modules, and Mouse

Using SQL Server Management Studio

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer

Malware Analysis Report

Getting Started Guide. Chapter 14 Customizing LibreOffice

Installing the Panini Universal Scanner Driver

Tidspunkt : : :59 (49 dag(e)) Operativsystem (OS) fordelt på browsere Total: Safari9 ios %

Table of Contents. Part I Introduction 2. Part II Keyboard Monitor 2. Part III Console Viewer 4. Part IV FAQ 5. Part V Support 6. Index 0.

Creating Database Tables in Microsoft SQL Server

Coding Rules. Encoding the type of a function into the name (so-called Hungarian notation) is forbidden - it only confuses the programmer.

Visualisation of potential weakness of existing cipher engine implementations in commercial on-the-fly disk encryption software

Developing an ODBC C++ Client with MySQL Database

Mac OS X guide for Windows users

User Manual. 3-Heights PDF Producer API. Version 4.6

Wireless Presentation System User s Manual

VisTablet Manual. For 12 VT Original and Mini Mouse

Getting Started with Virtual CEPC 1

Microsoft Win32 Internet Functions

Software Development Kit Manual

Windows API Functions

ODBC Client Driver Help Kepware, Inc.

Learning USB by Doing.

Habanero Extreme Scale Software Research Project

Wireless Printing Guide

Virtual Studio Technology Plug-In Specification 2.0 Software Development Kit

Product Description. Licenses Notice. Introduction TC-200

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Scanning. WorkCentre C2424 Copier-Printer

Introduction to Java

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

Help. Contents Back >>

The MAC address, short for Media Access Control address, is a number in hexadecimal format that uniquely identifies every machine on a network.

WinHLLAPI Language Reference

Objective-C Tutorial

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Magic Switch User Manual for Mac & Windows Mac to Mac / Mac to Windows / Windows to Windows / Windows/Mac to ipad Windows/Mac to Android

Customer Release Notes for Xerox Integrated Fiery Color Server for the Xerox Color C75 Press, version 1.0

Installation and Setup

[MS-RDPESC]: Remote Desktop Protocol: Smart Card Virtual Channel Extension

Access to Moodle. The first session of this document will show you how to access your Lasell Moodle course, how to login, and how to logout.

Legal Notes. Regarding Trademarks KYOCERA Document Solutions Inc.

Input and Interaction. Project Sketchpad. Graphical Input. Physical Devices. Objectives

Metadata Import Plugin User manual

Employee Manual Development Tool Version 7.0. User Guide

QUIT MACSCHOOL AND DRAG YOUR SERVER ICONS TO THE TRASH OR HIT THE DISCONNECT BUTTON BESIDE THE SERVER ICON IN THE TOP SIDEBAR

Win32 API Emulation on UNIX for Software DSM

PIC 10A. Lecture 7: Graphics II and intro to the if statement

MatrixSSL Porting Guide

Using Virtual PC 7.0 for Mac with GalleryPro

Setting up and using an external USB Flash Drive (Thumb Drive) on your Mac

Remote Control 5.4 Setup Guide

Transcription:

Lecture 2-1 Basic Data Types typedef short SHORT; typedef unsigned short WORD; typedef unsigned long DWORD; #if defined(_win64) typedef int64 INT_PTR; #else typedef int INT_PTR; #endif typedef DWORD COLORREF; typedef DWORD *LPCOLORREF; typedef PVOID HANDLE; typedef HANDLE *LPHANDLE; typedef HANDLE HWND; typedef HANDLE HINSTANCE; typedef LONG_PTR LPARAM; typedef UINT_PTR WPARAM; typedef LONG_PTR LRESULT; // 16-bit // 32-bit

Lecture 2-2 Basic Character and String Types typedef wchar_t WCHAR; #ifdef UNICODE typedef WCHAR TCHAR; #else typedef char TCHAR; #endif typedef CHAR *PCHAR; typedef CHAR *PSTR; typedef CHAR *LPSTR; typedef WCHAR *LPWSTR; #ifdef UNICODE typedef LPWSTR LPTSTR; #else typedef LPSTR LPTSTR; #endif typedef nullterminated CONST CHAR *LPCSTR; typedef CONST WCHAR *LPCWSTR; #ifdef UNICODE typedef LPCWSTR LPCTSTR; #else typedef LPCSTR LPCTSTR; #endif

Lecture 2-3 The Hungarian Notation bdone ctotal chfirstletter dwvalue fdone nsize fpprice dbvalue pptr rgvalues szname psztext lpszwindowtext wvalue uwvalue lvalue hwndmain m_something m_rgfpvalues boolean / byte counter int, long, uint etc. character double word flag boolean integer floating-point double pointer range array zero-terminated string pointer to zero-terminated string long pointer to zero-terminated string word unsigned word long handle to a window member of a class array of floating-point values

Lecture 2-4 Macros int GET_X_LPARAM(LPARAM lparam); int GET_Y_LPARAM(LPARAM lparam); BYTE HIBYTE(WORD wvalue); BYTE LOBYTE(WORD wvalue); WORD HIWORD(DWORD dwvalue); WORD LOWORD(DWORD dwvalue); DWORD MAKELONG(WORD wlow, WORD whigh); WORD MAKEWORD(BYTE blow, BYTE bhigh); WPARAM MAKEWPARAM(WORD wlow, WORD whigh); LPARAM MAKELPARAM(WORD wlow,word whigh); LRESULT MAKELRESULT(WORD wlow, WORD whigh);

Lecture 2-5 Graphical Structures typedef struct tagpoint { LONG x; LONG y; } POINT, *PPOINT; typedef struct tagpoints { SHORT x; SHORT y; } POINTS, *PPOINTS; typedef struct _RECT { LONG left; LONG top; LONG right; LONG bottom; } RECT, *PRECT; typedef struct tagsize { LONG cx; LONG cy; } SIZE, *PSIZE;

Lecture 2-6 The Mouse Window client area s messages WM_MOUSEMOVE WM_LBUTTONDOWN,...UP,...DBLCLK (L, M, R) WM_MOUSEHOVER, WM_MOUSELEAVE, TrackMouseEvent() wparam for these messages: MK_LBUTTON, MK_MBUTTON, MK_RBUTTON, MK_CONTROL, MK_SHIFT Other messages WM_NCHITTEST WM_NCMOUSEMOVE WM_NCLBUTTONDOWN,...UP,...DBLCLK WM_NCMOUSEHOVER, WM_NCMOUSELEAVE Double click - CS_DBLCLKS style for the window class order of messages: DOWN, UP, DBLCLK, UP

Lecture 2-7 Mouse Features The cursor monochrome or color, static or animated, with a hot spot LoadCursor(), LoadImage(), LoadCursorFromFile() GetCursorPos(), SetCursorPos() ShowCursor(), GetCursorInfo(), ClipCursor() SetClassLong(), CopyCursor(), DestroyCursor() WM_SETCURSOR Mouse capturing the way to receive mouse messages when the cursor is outside the window SetCapture(), ReleaseCapture(), WM_CAPTURECHANGED Settings GetSystemMetrics(), SystemParametersInfo()

Lecture 2-8 Other Mouse Features Wheel [95/NT 3.51] WM_MOUSEWHEEL ClickLock [Me/XP] ignoring of releasing a mouse button Sonar [Me/XP] drawing circles around the cursor after pushing CTRL key Vanish [Me/XP] hiding cursor during writing on the keyboard XBUTTONs [2000+] 5 mouse buttons

Lecture 2-9 Scenario of Using the Keyboard 1. The user pushes or releases any key 2. The keyboard sends the scan code of the key to the driver scan code identifier of the key, dependend on the keyboard 3. The driver finds the virtual-key code of the key virtual-key code independend on the keyboard 4. A new message containing both the scan code and the virtual-key code is sent to the system message queue 5. The system gets the message from the queue and sends it to the message queue of the thread, which window has a focus 6. The message is dispatched in the window procedure

Lecture 2-10 Using Keyboard Messages Keystroke messages WM_KEYDOWN, WM_KEYUP WM_SYSKEYDOWN, WM_SYSKEYUP automatic repeating feature of the keyboard: many WM_KEYDOWN, one WM_KEYUP the lparam parameter contains the repeat counter Character messages generated by TranslateMessage() from keystroke messages WM_CHAR, WM_DEADCHAR, WM_SYSCHAR, WM_SYSDEADCHAR, WM_UNICHAR Conversions MapVirtualKey(), ToAscii(), ToUnicode(), VkKeyScan()

Lecture 2-11 Keyboard Features Focus only one window can have the focus active or its descendant SetFocus(), GetFocus() WM_SETFOCUS, WM_KILLFOCUS Caret a graphical symbol of getting the keyboard input CreateCaret(), DestroyCaret() ShowCaret(), HideCaret() GetCaretBlinkTime(), SetCaretBlinkTime() GetCaretPos(), SetCaretPos() Key state GetKeyState(), GetAsyncKeyState() GetKeyboardState(), SetKeyboardState()

Other Keyboard Features Hot-key Lecture 2-12 a combination of keys which generates WM_HOTKEY RegisterHotKey(), UnregisterHotKey() send a WM_SETHOTKEY message to a window to associate a hot key with the window (pressing the hot key activates the window) Special keys [Me/2000] WM_APPCOMMAND Language settings LoadKeyboardLayout(), UnloadKeyboardLayout() ActivateKeyboardLayout() Simulation of using the mouse or keyboard SendInput() [98/NT4SP3] keybd_event(), mouse_event() [95/NT3.51]

Lecture 2-13 Windows History Xerox, graphical UI,70s MS-DOS 1981 Macintosh January 1984 Windows 1.0 20.11.1985 Windows 2.0 9.12.1987 OS/2 1.1 October 1988 Windows 3.0 22.05.1990 Windows 3.1 April 1992 Windows 95 24.08.1995 Windows 98 25.06.1998 Windows Me 19.06.2000 Windows NT 3.1 27.07.1993 Windows NT 4.0 29.07.1996 Windows 2000 17.02.2000 Windows XP 25.10.2001 Windows Server 2003 24.04.2003 Windows Vista 30.01.2007 Windows Home Server 16.06.2007 Windows Server 2008 27.02.2008 Windows 7 beta, January 2009

Wersje Windows http://en.wikipedia.org Lecture 2-14

Lecture 2-15

Checking Windows Version GetVersionEx() major minor platformid producttype 95 4 0 VER_PLATFORM_WIN32_WINDOWS 98 4 10 VER_PLATFORM_WIN32_WINDOWS Me 4 90 VER_PLATFORM_WIN32_WINDOWS NT 3.51 3 51 VER_PLATFORM_WIN32NT NT 4.0 4 0 VER_PLATFORM_WIN32NT 2000 5 0 VER_PLATFORM_WIN32NT XP 5 1 VER_PLATFORM_WIN32NT 2003 5 2 VER_PLATFORM_WIN32NT VerifyVersionInfo() Lecture 2-16 Vista 6 0 VER_PLATFORM_WIN32NT VER_NT_WORKSTATION 2008 6 0 VER_PLATFORM_WIN32NT VER_NT_SERVER 7 6 1 VER_PLATFORM_WIN32NT VER_NT_WORKSTATION 2008 R2 6 1 VER_PLATFORM_WIN32NT VER_NT_SERVER

Operating Systems Statistics Internet users operating systems: Lecture 2-17 Poland World Windows XP 84,1% Windows XP 71,4% Windows Vista 13,6% Windows Vista 15,6% Windows 2000 0,6% Mac 5,3% Windows 98 0,6% Linux 3,8% Linux 0,4% Windows 2000 1,7% MacOS X 0,3% Windows 2003 1,7% Windows 2003 0,1% Windows 98 0,1% Windows ME 0,1% http://www.ranking.pl January 2009 http://www.w3schools.com December 2008