summaryrefslogtreecommitdiff
path: root/windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-10 20:48:08 -0500
committerPietro Gagliardi <[email protected]>2014-02-10 20:48:08 -0500
commit07c791331c507334f33fececbfeb68b97c89a44d (patch)
treefd539d6ab4b9bc3dd703befc6c4238bab8928062 /windows.go
parentbcc8751c8ba5f54d5da74aa7e38741dadd62fea8 (diff)
Improved program appearance by setting the correct font, colors, and other styles.
Diffstat (limited to 'windows.go')
-rw-r--r--windows.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/windows.go b/windows.go
index 6f0f4c1..de6fd6f 100644
--- a/windows.go
+++ b/windows.go
@@ -134,6 +134,7 @@ const (
var (
createWindowEx = user32.NewProc("CreateWindowExW")
destroyWindow = user32.NewProc("DestroyWindow")
+ enumChildWindows = user32.NewProc("EnumChildWindows")
showWindow = user32.NewProc("ShowWindow")
)
@@ -166,6 +167,27 @@ func DestroyWindow(hWnd HWND) (err error) {
return nil
}
+type WNDENUMPROC func(hwnd HWND, lParam LPARAM) (cont bool)
+type _WNDENUMPROC func(hwnd HWND, lParam LPARAM) int
+
+func enumChildProc(p WNDENUMPROC) _WNDENUMPROC {
+ return func(hwnd HWND, lParam LPARAM) int {
+ if p(hwnd, lParam) {
+ return TRUE
+ }
+ return FALSE
+ }
+}
+
+// TODO figure out how to handle errors
+func EnumChildWindows(hWndParent HWND, lpEnumFunc WNDENUMPROC, lParam LPARAM) (err error) {
+ enumChildWindows.Call(
+ uintptr(hWndParent),
+ syscall.NewCallback(enumChildProc(lpEnumFunc)),
+ uintptr(lParam))
+ return nil
+}
+
// TODO figure out how to handle errors
func ShowWindow(hWnd HWND, nCmdShow int) (previouslyVisible bool, err error) {
r1, _, _ := showWindow.Call(