explaingit

microsoft/windows-classic-samples

5,603Audience · developerComplexity · 3/5Setup · moderate

TLDR

An official Microsoft collection of small, self-contained code samples demonstrating how to use Windows programming APIs for building traditional desktop applications on Windows and Windows Server.

Mindmap

mindmap
  root((windows-classic-samples))
    What it is
      Official Microsoft samples
      Win32 and Windows Server APIs
      No single deployable app
    Sample structure
      Visual Studio solution per sample
      Self-contained source code
      Compiles and runs standalone
    How to use
      Clone locally
      Find in Files to search APIs
      Visual Studio Community free
    Audience
      Windows desktop developers
      API reference seekers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Find a working, compilable code example of a specific Windows API call to use as a reference while building a desktop app.

USE CASE 2

Bootstrap a new Win32 application by adapting a complete sample that already handles boilerplate window creation and message loops.

USE CASE 3

Learn how a specific Windows system interface works by studying a small, focused project that exercises only that feature.

Tech stack

C++C#Visual StudioWin32 APIWindows SDK

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Visual Studio and the Windows SDK, Visual Studio Community edition is free.

In plain English

This repository is a collection of code samples from Microsoft that show how to use the Windows programming interfaces for building traditional desktop applications. These are the kind of applications that run directly on Windows as standalone programs, as opposed to web apps or the newer Universal Windows Platform (UWP) style apps. Each sample is a small, self-contained project with its own Visual Studio solution file and all the source code needed to compile and run it. The samples cover the programming models and APIs available on Windows and Windows Server. Most were written for Windows 7, Windows 8.1, or Windows Server 2012 R2 using Visual Studio 2013, though many also work on newer versions of Windows. The primary intended audience is developers who want to see working examples of specific Windows API calls. Microsoft recommends cloning the repository locally and using Visual Studio's Find in Files feature to search across all the sample code for a particular API name. This makes it easy to find a concrete example of how any given Windows function is actually used in practice. Visual Studio Community edition is free and sufficient for this purpose. The repository does not contain UWP (Universal Windows Platform) samples, those live in a separate repository. Links to related sample collections and the official Windows developer documentation are included in the README.

Copy-paste prompts

Prompt 1
I am building a Win32 desktop application and need to use the [specific Windows API]. Help me find and understand the relevant sample in the microsoft/windows-classic-samples repository and adapt it to my use case.
Prompt 2
Show me how to create a basic Win32 window with a message pump, using the pattern from the windows-classic-samples repository as a starting point.
Prompt 3
Help me search the windows-classic-samples repo for all examples that use the [API function name] and explain what each one is demonstrating.
Open on GitHub → Explain another repo

← microsoft on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.