Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind function SetLayeredWindowAttributes #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
}