The Win32 Application Programmer's Interface (API) is the native Windows C/C++ GUI development library..

"winanim" is a well-known example of animation using the Win32 API in a C program.
The winanim program shows a red ball bouncing on the sides of a window.



Before we start

Create a "winanim" subdirectory somewhere you choose to build this example.

Get the example from the zip file: winanim.zip

Save the archive into the new "winanim" subdirectory, and extract the source files from the archive.

You should have the files shown here: winanim files

The C code for "winanim" is in Main.c.
The red ball image is in ball.bmp.
The ballmask.bmp is used to erase the last position of the ball from the window.
Anim.ico is the icon that shows in explorer next to the produced winanim.exe program file.
Anim.rc and Images.rc are Windows resources files used to produce winanim.
(Anim.rc is the main resource file. It includes Images.rc)
winanim [winanim.exe].PRJ is a Quincy project file for the winanim project.
___________

Open the "winanim" project file with Quincy

- Note that both the main resource file and the C code file have be "inserted" into the project.winanimProject
- If you examine the project properties using the [Project]->[Properties] menu entry, you will see that the selected "Type of Build" is Win32 GUI application.

Build the "winanim" project

- The build happens in 3 stages:

Execute the winanim program, enjoy.


- Win32 API is the basic, native Windows GUI and graphics library. Since it works directly with the operating system, it is likely to produce the fastest and smallest executables. It is however not intuitive to use, but is frequently used from C programs. If you want to learn it, you should procure a good book (or two). You will also find some basic tutorials on the internet.

For simple graphics in C (but not menus, buttons, scrollbars, etc...) WinBGIm is much simpler to use.

Most frequently, Windows GUI programs are produced using C++ class libraries. FLTK, available with Quincy is such a library.