Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

windigo

> 编程语言
Open source

Windows API and GUI in idiomatic Go.

635 stars0 likes0 views
WebsiteGitHub

About

Windows API and GUI in idiomatic Go.

Windigo

Win32 API and GUI in idiomatic Go.

Handwritten since 2019.

Windigo is designed to be familiar to C/C++ Win32 programmers, using the same concepts, and an API as close as possible to the original Win32 API. This allows most C/C++ Win32 tutorials and examples to be translated to Go.

Notably, Windigo is written 100% in pure Go – CGo is not used, just native syscalls.

Windigo is based in Go 1.20, so it can be built in Windows 7 and above.

Install

go get -u github.com/rodrigocfd/windigo

Current status

Native FFI items currently implemented:

Native FFI item Count
Handles 32
Structs 212
Functions 706
COM interfaces 84
COM methods 560
Const types 443
Const values 11,303

Examples

In the examples below, error checking is ommited for brevity.

GUI window

GUI window

The example below creates a window programmatically, and handles the button click. Also, it uses the minimal.syso provided in the _resources folder.

…

To compile the final .exe file, run the command:

go build -trimpath -ldflags "-s -w -H=windowsgui"

Registry access

Registry access

…

Enumerating running processes

Enumerating running processes

The example below takes a process snapshot to list the running processes:

go
package main

import (
	"github.com/rodrigocfd/windigo/co"
	"github.com/rodrigocfd/windigo/win"
)

func main() {
	hSnap, _ := win.CreateToolhelp32Snapshot(co.TH32CS_SNAPPROCESS, 0)
	defer hSnap.CloseHandle()

	processes, _ := hSnap.EnumProcesses()
	for _, nfo := range processes {
		println("PID:", nfo.Th32ProcessID, "name:", nfo.SzExeFile())
	}

	println(len(processes), "found")
}

Taking a screenshot

Taking a screenshot

This complex example takes a screenshot using GDI and saves it to a BMP file.

…

Component Object Model (COM)

Component Object Model (COM)

Windigo has full support for C++ COM objects. The cleanup is performed by a win.OleReleaser object, which calls Release on multiple COM objects at once, much like an arena allocator. Every function which produces a COM object requires a win.OleReleaser to take care of its lifetime.

The example below uses COM objects to display the system native Open File window:

…

COM Automation

COM Automation

Windigo has bindings to IDispatch COM interface and VARIANT parameters, allowing you to invoke Automation methods.

The example below manipulates an Excel spreadsheet, saving a copy of it:

…

Architecture

The library is divided in several packages. Core packages are located at at the root of the library, extended packages under x/ subdirectory.

Entities Consts Description
ui – Core high-level UI windows and controls
wstr – Core string and UTF-16 wide string management
win co Core Win32 components
winaut coaut Automation
windxgi codxgi DirectX Graphics Infrastructure
winsh cosh Windows Shell
wintasks cotasks Task Scheduler
winwic cowic Windows Imaging Component

Core packages dependency:

mermaid
flowchart BT
    internal/utl([internal/utl]) --> co
    ui --> win
    win --> internal/dll([internal/dll])
    win --> internal/utl
    win --> wstr

License

Licensed under MIT license, see LICENSE.md for details.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gobindingsffigogolang

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言