WINAPI Programming

From Wikiversity
Jump to navigation Jump to search

Welcome[edit | edit source]

This Tutorial is intended for anyone who has a working knowledge of the C programming language. It is also intended to help you develop Windows Apps using the WINAPI ASAP. The language used is C. This tutorial is applicable to any language that acesses the WINAPI. Free tutoring is available, just leave a message at the bottom of this page.

Getting Started[edit | edit source]

The basics and begining information. Get Started

A Simple Window[edit | edit source]

Describes how to create a window. Lesson One

Message Handling[edit | edit source]

Describes message handling in the main Window Procedure. Messages

Sample Code[edit | edit source]

This example simply displays a message box after compiling and running the project.

#include <windows.h>

int _stdcall WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
	MessageBox (NULL, TEXT("Hello"), TEXT("Hello, Windows!"), MB_OK);
	return 0;

Note: You may need to include the user32.lib for the linker when compiling this project.

See Also[edit | edit source]