diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-10 20:48:08 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-10 20:48:08 -0500 |
| commit | 07c791331c507334f33fececbfeb68b97c89a44d (patch) | |
| tree | fd539d6ab4b9bc3dd703befc6c4238bab8928062 /windows.go | |
| parent | bcc8751c8ba5f54d5da74aa7e38741dadd62fea8 (diff) | |
Improved program appearance by setting the correct font, colors, and other styles.
Diffstat (limited to 'windows.go')
| -rw-r--r-- | windows.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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( |
