Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions user32.go
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,7 @@ var (
updateWindow uintptr
windowFromDC uintptr
windowFromPoint uintptr
setLayeredWindowAttributes uintptr
)

func init() {
Expand Down Expand Up @@ -1779,6 +1780,7 @@ func init() {
updateWindow = MustGetProcAddress(libuser32, "UpdateWindow")
windowFromDC = MustGetProcAddress(libuser32, "WindowFromDC")
windowFromPoint = MustGetProcAddress(libuser32, "WindowFromPoint")
setLayeredWindowAttributes = MustGetProcAddress(libuser32, "SetLayeredWindowAttributes")
}

func AddClipboardFormatListener(hwnd HWND) bool {
Expand Down Expand Up @@ -2899,3 +2901,15 @@ func WindowFromPoint(Point POINT) HWND {

return HWND(ret)
}

func SetLayeredWindowAttributes(hwnd HWND, crKey COLORREF, bAlpha byte, dwFlags uint32) bool {
ret, _, _ := syscall.Syscall6(setLayeredWindowAttributes, 4,
uintptr(hwnd),
uintptr(crKey),
uintptr(bAlpha),
uintptr(dwFlags),
0,
0)

return ret != 0
}