# winapi **Repository Path**: msgy/winapi ## Basic Information - **Project Name**: winapi - **Description**: Windows API 的 Go 封装。 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-03-18 - **Last Updated**: 2021-07-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # winapi # 这是用 Go 编写的调用 Windows API 的包。将 Windows API 转换成 Go 的风格,使其易用。 ## 使用方法 ## 本包不依赖任何第三方包、框架或库。 任何安装了 Go 环境的 Windows 系统都可以使用。 ## 已实现的或有所改变的 API ## 我没有照搬 Windows API,而是在做了一些妥善的改动。例如,不封装`CreateWindow`而封装 `CreateWindowEx`,封装之后的Go的函数名为`CreateWindow`。 ### gdi ### BitBlt DeleteObject GetObject CreateCompatibleDC SelectObject DeleteDC ### kernel ### GetLastError ExitProcess CreateFile ReadFile WriteFile SetFilePointer GetModuleHandle CloseHandle FormatMessage ### user ### DefWindowProc
GetMessage
RegisterClass
MessageBox
CreateWindow
ShowWindow
UpdateWindow
TranslateMessage
DispatchMessage
PostQuitMessage
DestroyWindow
LoadString
LoadIcon - 分解为 LoadIconById 和 LoadIconByName
LoadCursor - 分解为 LoadCursorById 和 LoadCursorByName
LoadBitmap - 分解为 LoadBitmapById 和 LoadBitmapByName
LoadImage - 分解为 LoadImageById 和 LoadImageByName
BeginPaint
EndPaint
### comdlg ### 暂无 ## 增加的函数 ## ErrorBox
ErrorAssert
WinErrorAssert
## 不实现的函数 ## 与线程相关的函数,如`CreateThread`、`CreateMutex`,因为Go已经有了很好的并发特性。 ## TODO ## 实现COM接口的封装,DirectX等。 ## 协议 ## 本项目采用与`golang`相同的协议。