summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2019-05-08 16:46:31 +0200
committerAlexander Neumann <alexander.neumann@picos-software.com>2019-05-08 16:46:31 +0200
commit128b91335ca07c8e185b67c99eee1fce03642def (patch)
treef95b6da7a2d19074518117c9239d51d244fad0ae
parentFix for previous commit (diff)
downloadwireguard-windows-128b91335ca07c8e185b67c99eee1fce03642def.tar.xz
wireguard-windows-128b91335ca07c8e185b67c99eee1fce03642def.zip
Add GetIconInfo
-rw-r--r--user32.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/user32.go b/user32.go
index 3f16ef5d..aeded251 100644
--- a/user32.go
+++ b/user32.go
@@ -1661,6 +1661,7 @@ var (
getDpiForWindow *windows.LazyProc
getFocus *windows.LazyProc
getForegroundWindow *windows.LazyProc
+ getIconInfo *windows.LazyProc
getKeyState *windows.LazyProc
getMenuInfo *windows.LazyProc
getMessage *windows.LazyProc
@@ -1793,6 +1794,7 @@ func init() {
getDpiForWindow = libuser32.NewProc("GetDpiForWindow")
getFocus = libuser32.NewProc("GetFocus")
getForegroundWindow = libuser32.NewProc("GetForegroundWindow")
+ getIconInfo = libuser32.NewProc("GetIconInfo")
getKeyState = libuser32.NewProc("GetKeyState")
getMenuInfo = libuser32.NewProc("GetMenuInfo")
getMessage = libuser32.NewProc("GetMessageW")
@@ -2357,6 +2359,15 @@ func GetForegroundWindow() HWND {
return HWND(ret)
}
+func GetIconInfo(hicon HICON, piconinfo *ICONINFO) bool {
+ ret, _, _ := syscall.Syscall(getIconInfo.Addr(), 2,
+ uintptr(hicon),
+ uintptr(unsafe.Pointer(piconinfo)),
+ 0)
+
+ return ret != 0
+}
+
func GetKeyState(nVirtKey int32) int16 {
ret, _, _ := syscall.Syscall(getKeyState.Addr(), 1,
uintptr(nVirtKey),