intro to windows programming

8
Intro to Windows Programming Basic Ideas

Upload: shanna

Post on 11-Jan-2016

14 views

Category:

Documents


0 download

DESCRIPTION

Intro to Windows Programming. Basic Ideas. Program Entry Point. Int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) Acts as an entry point just as a main function would act in a C program. Common Header Files. WINDEF.H – Basic type definitions. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Intro to Windows Programming

Intro to Windows Programming

Basic Ideas

Page 2: Intro to Windows Programming

Program Entry Point

Int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)

Acts as an entry point just as a main function would act in a C program.

Page 3: Intro to Windows Programming

Common Header Files

WINDEF.H – Basic type definitions. WINNT.H – Type definitions for Unicode

support WINBASE.H – Kernel functions. WINUSER.H – User interface functions WINGDI.H – Graphics device interface

functions.

Page 4: Intro to Windows Programming

Message Box function

int WINAPI messageBox (HWND,LPCSTR,LPCSTR, UINT)

Acts as a way do display a message onto the screen.

Page 5: Intro to Windows Programming

Different String Functions

ILength pString IComp They can do a variety of things such as

calculate string lengths, copy strings, concatenate strings, and compare strings.

Page 6: Intro to Windows Programming

Handles

HINSTANCE – Handle to an “instance” – the program itself

HWND – Handle to the window HDC – Handle to a device context The type of the object allows your

program to know how to use the handle

Page 7: Intro to Windows Programming

Data Structures

MSG – Message structure WNDCLASS – Window class structure PAINTSTRUCTURE – Paint structure RECT – Rectangle structure First two data structures are used in

WinMain and the second two are used in WndProc

Page 8: Intro to Windows Programming

Other Messages

wParm – a 32-bit message parameter dependent on the particcular message

lParam – same as above Pt – mouse coordinates at the time the

message was placed in the message queue