Skip to content

Commit fb04ddd

Browse files
ToadKingbsiegert
authored andcommitted
windows: add DWM window attribute related syscalls
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmgetwindowattribute https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute Change-Id: I96a68f91f745601e93c0cc21cc4f1f4c5e7d8b9e GitHub-Last-Rev: bdbe2cc GitHub-Pull-Request: #123 Reviewed-on: https://go-review.googlesource.com/c/sys/+/399135 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Run-TryBot: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
1 parent 7b5979e commit fb04ddd

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

windows/syscall_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
442442
//sys RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) = ntdll.RtlAddFunctionTable
443443
//sys RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) = ntdll.RtlDeleteFunctionTable
444444

445+
// Desktop Window Manager API (Dwmapi)
446+
//sys DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) = dwmapi.DwmGetWindowAttribute
447+
//sys DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) = dwmapi.DwmSetWindowAttribute
448+
445449
// syscall interface implementation for other packages
446450

447451
// GetCurrentProcess returns the handle for the current process.

windows/types_windows.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,3 +3232,29 @@ type GUIThreadInfo struct {
32323232
CaretHandle HWND
32333233
CaretRect Rect
32343234
}
3235+
3236+
const (
3237+
DWMWA_NCRENDERING_ENABLED = 1
3238+
DWMWA_NCRENDERING_POLICY = 2
3239+
DWMWA_TRANSITIONS_FORCEDISABLED = 3
3240+
DWMWA_ALLOW_NCPAINT = 4
3241+
DWMWA_CAPTION_BUTTON_BOUNDS = 5
3242+
DWMWA_NONCLIENT_RTL_LAYOUT = 6
3243+
DWMWA_FORCE_ICONIC_REPRESENTATION = 7
3244+
DWMWA_FLIP3D_POLICY = 8
3245+
DWMWA_EXTENDED_FRAME_BOUNDS = 9
3246+
DWMWA_HAS_ICONIC_BITMAP = 10
3247+
DWMWA_DISALLOW_PEEK = 11
3248+
DWMWA_EXCLUDED_FROM_PEEK = 12
3249+
DWMWA_CLOAK = 13
3250+
DWMWA_CLOAKED = 14
3251+
DWMWA_FREEZE_REPRESENTATION = 15
3252+
DWMWA_PASSIVE_UPDATE_MODE = 16
3253+
DWMWA_USE_HOSTBACKDROPBRUSH = 17
3254+
DWMWA_USE_IMMERSIVE_DARK_MODE = 20
3255+
DWMWA_WINDOW_CORNER_PREFERENCE = 33
3256+
DWMWA_BORDER_COLOR = 34
3257+
DWMWA_CAPTION_COLOR = 35
3258+
DWMWA_TEXT_COLOR = 36
3259+
DWMWA_VISIBLE_FRAME_BORDER_THICKNESS = 37
3260+
)

windows/zsyscall_windows.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)