1 / 8

Intro to Windows Programming

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.

shanna
Download Presentation

Intro to Windows Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Windows Programming Basic Ideas

  2. 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.

  3. 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.

  4. Message Box function • int WINAPI messageBox (HWND,LPCSTR,LPCSTR, UINT) • Acts as a way do display a message onto the screen.

  5. 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.

  6. 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

  7. 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

  8. 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

More Related