79 Star 313 Fork 53

不在乎y/govcl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
intf_posix.go 1.92 KB
一键复制 编辑 原始数据 按行查看 历史
不在乎y 提交于 2020-03-23 16:07 . Update comments.
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
// +build !windows
package api
import (
"unsafe"
. "github.com/ying32/govcl/vcl/types"
)
var (
dSendMessage = libvcl.NewProc("DSendMessage")
dPostMessage = libvcl.NewProc("DPostMessage")
dIsIconic = libvcl.NewProc("DIsIconic")
dIsWindow = libvcl.NewProc("DIsWindow")
dIsZoomed = libvcl.NewProc("DIsZoomed")
dIsWindowVisible = libvcl.NewProc("DIsWindowVisible")
dGetDC = libvcl.NewProc("DGetDC")
dReleaseDC = libvcl.NewProc("DReleaseDC")
dSetForegroundWindow = libvcl.NewProc("DSetForegroundWindow")
dWindowFromPoint = libvcl.NewProc("DWindowFromPoint")
)
func DSendMessage(hWd HWND, msg uint32, wParam, lParam uintptr) uintptr {
r, _, _ := dSendMessage.Call(hWd, uintptr(msg), wParam, lParam)
return r
}
func DPostMessage(hWd HWND, msg uint32, wParam, lParam uintptr) bool {
r, _, _ := dPostMessage.Call(hWd, uintptr(msg), wParam, lParam)
return r != 0
}
func DIsIconic(hWnd HWND) bool {
r, _, _ := dIsIconic.Call(uintptr(hWnd))
return r != 0
}
func DIsWindow(hWnd HWND) bool {
r, _, _ := dIsWindow.Call(uintptr(hWnd))
return r != 0
}
func DIsZoomed(hWnd HWND) bool {
r, _, _ := dIsZoomed.Call(uintptr(hWnd))
return r != 0
}
func DIsWindowVisible(hWnd HWND) bool {
r, _, _ := dIsWindowVisible.Call(uintptr(hWnd))
return r != 0
}
func DGetDC(hWnd HWND) HDC {
r, _, _ := dGetDC.Call(uintptr(hWnd))
return HDC(r)
}
func DReleaseDC(hWnd HWND, dc HDC) int {
r, _, _ := dReleaseDC.Call(uintptr(hWnd), uintptr(dc))
return int(r)
}
func DSetForegroundWindow(hWnd HWND) bool {
r, _, _ := dSetForegroundWindow.Call(uintptr(hWnd))
return r != 0
}
func DWindowFromPoint(point TPoint) HWND {
r, _, _ := dWindowFromPoint.Call(uintptr(unsafe.Pointer(&point)))
return HWND(r)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ying32/govcl.git
git@gitee.com:ying32/govcl.git
ying32
govcl
govcl
v2.0.10

搜索帮助

0d507c66 1850385 C8b1a773 1850385