百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

windigo

> 编程语言
开源

以习惯性 Go 语言编写的 Windows API 和 GUI。

635 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

以习惯性 Go 语言编写的 Windows API 和 GUI。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gobindingsffigogolang

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

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