summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2019-05-29 14:07:26 +0200
committerAlexander Neumann <alexander.neumann@picos-software.com>2019-05-29 14:07:26 +0200
commit270e6e4be94d3a5068e75225f1013ad723e0dabc (patch)
tree97806eaccf46f3e56de6c5de7854c9345282f605
parentAdd LVM_SETBKCOLOR (diff)
downloadwireguard-windows-270e6e4be94d3a5068e75225f1013ad723e0dabc.tar.xz
wireguard-windows-270e6e4be94d3a5068e75225f1013ad723e0dabc.zip
Add GetThemeColor and some related constants
-rw-r--r--uxtheme.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/uxtheme.go b/uxtheme.go
index 66f52a6e..7f0ba6e9 100644
--- a/uxtheme.go
+++ b/uxtheme.go
@@ -7,9 +7,16 @@
package win
import (
- "golang.org/x/sys/windows"
"syscall"
"unsafe"
+
+ "golang.org/x/sys/windows"
+)
+
+// TMT_COLOR property ids
+const (
+ TMT_FILLCOLOR = 3802
+ TMT_TEXTCOLOR = 3803
)
// CheckBox parts
@@ -145,6 +152,7 @@ var (
closeThemeData *windows.LazyProc
drawThemeBackground *windows.LazyProc
drawThemeTextEx *windows.LazyProc
+ getThemeColor *windows.LazyProc
getThemePartSize *windows.LazyProc
getThemeTextExtent *windows.LazyProc
isAppThemed *windows.LazyProc
@@ -160,6 +168,7 @@ func init() {
closeThemeData = libuxtheme.NewProc("CloseThemeData")
drawThemeBackground = libuxtheme.NewProc("DrawThemeBackground")
drawThemeTextEx = libuxtheme.NewProc("DrawThemeTextEx")
+ getThemeColor = libuxtheme.NewProc("GetThemeColor")
getThemePartSize = libuxtheme.NewProc("GetThemePartSize")
getThemeTextExtent = libuxtheme.NewProc("GetThemeTextExtent")
isAppThemed = libuxtheme.NewProc("IsAppThemed")
@@ -206,6 +215,18 @@ func DrawThemeTextEx(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pszText *u
return HRESULT(ret)
}
+func GetThemeColor(hTheme HTHEME, iPartId, iStateId, iPropId int32, pColor *COLORREF) HRESULT {
+ ret, _, _ := syscall.Syscall6(getThemeColor.Addr(), 5,
+ uintptr(hTheme),
+ uintptr(iPartId),
+ uintptr(iStateId),
+ uintptr(iPropId),
+ uintptr(unsafe.Pointer(pColor)),
+ 0)
+
+ return HRESULT(ret)
+}
+
func GetThemePartSize(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, prc *RECT, eSize THEMESIZE, psz *SIZE) HRESULT {
ret, _, _ := syscall.Syscall9(getThemePartSize.Addr(), 7,
uintptr(hTheme),