feat(dll): 自 go-hua 迁入 Windows 系统 API 封装

- 互斥体防多开/ShellExecute/窗口类名与标题查询/顶层窗口目录, 新增依赖 lxn/win
- 仅 Windows, 附测试、examples/dll 例程与包 README
This commit is contained in:
2026-09-20 12:29:36 +08:00
parent a4920a6a8e
commit ef7cd3e3c4
7 changed files with 390 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package dll
import "syscall"
// kernel32.dll 互斥体相关 API 函数指针
var (
kernel32Dll *syscall.DLL
procCreateMutexW *syscall.Proc
procOpenMutexW *syscall.Proc
procReleaseMutex *syscall.Proc
)
func init() {
kernel32Dll = syscall.MustLoadDLL("kernel32.dll")
procCreateMutexW = kernel32Dll.MustFindProc("CreateMutexW")
procOpenMutexW = kernel32Dll.MustFindProc("OpenMutexW")
procReleaseMutex = kernel32Dll.MustFindProc("ReleaseMutex")
}