Skip to content

Small collection of example programs demonstrating how to build graphical user interfaces on Windows using the Win32 API in C

Notifications You must be signed in to change notification settings

avelic5/Win32GUIExamples-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Win32GUIExamples

This repository contains examples of Windows GUI applications using the Win32 API. Each example demonstrates specific aspects of Win32 development, such as window creation, event handling, and custom rendering.

🚀 Features

Basic Win32 window creation Message loop and event handling User interaction via buttons and menus Custom drawing with GDI Dialog boxes and additional UI elements ##🛠 Installation Clone the repository: git clone https://github.com/avelic5/Win32GUIExamples-.git Open the project in any C development environment that supports Win32 API (e.g., Visual Studio, Code::Blocks, MinGW, CMake with Ninja, etc.). Compile and run the examples using the provided source files.

Examples

Below are descriptions of each example.

Example 1 - Olympic Rings

This example demonstrates how to draw the Olympic Rings using the GDI in a Win32 application. It covers:

  • Handling WM_PAINT messages
  • Drawing circles in different colors to create the Olympic rings
  • Using BeginPaint and EndPaint for efficient rendering

Screenshot 2025-02-18 164318

Example 2 - Merge Messages

This example allows the user to input two separate messages and then combines them by pressing a button. Key features include:

  • Capturing user input through text fields
  • Dynamically updating the window with the merged message after button click
  • Handling WM_COMMAND for button interaction

Screenshot 2025-02-18 164230

Example 3 - Display Message in New Window

In this example, the user enters a message, and after pressing a button, a new window pops up displaying that message. Key concepts:

  • Capturing and handling user input
  • Creating and managing multiple windows
  • Displaying a message in a new window

Screenshot 2025-02-18 164358

Example 4 - Timer Button

This example shows how to create a button that starts a timer to track the time elapsed after it is pressed. Features include:

  • Starting a timer when the button is clicked
  • Displaying the time elapsed since the button press
  • Handling WM_TIMER for time updates

Screenshot 2025-02-18 164428

Example 5 - Dynamic Circle Sizing

This example allows the user to input a number, which then determines the size of two circles: one on the left and one on the right. It covers:

Capturing user input

  • Dynamically adjusting UI elements
  • Redrawing circles based on the selected value
  • Handling WM_PAINT for real-time updates

Screenshot 2025-02-18 164450

Example 6 - Musical Note Display

This example simulates a simple musical note selection interface. The user can press a button to display one of the musical notes: Do, Re, Mi, Fa, So, La. Key features include:

  • Creating buttons for each musical note
  • Handling button click events
  • Updating the window to display the selected note

Screenshot 2025-02-18 164506

About

Small collection of example programs demonstrating how to build graphical user interfaces on Windows using the Win32 API in C

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages