diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-30 14:13:47 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-30 14:15:32 -0400 |
| commit | c543f5639b121bcdae11f681466c030394902f65 (patch) | |
| tree | 79d951d0fe67d0d3908223625b4acd469ae78b60 /stdwndclass_windows.go | |
| parent | 78c909cc9ba87abc759767c11b34a9cccf8ef34c (diff) | |
Normalized DefWindowProc() handling across the Windows files; the syscall.LazyProc now has the normalized name _defWindowProc and defWindowProc() is a convenience function that calls _defWindowProc properly. This will also be important for the switch to a single window class per Window/Area.
Diffstat (limited to 'stdwndclass_windows.go')
| -rw-r--r-- | stdwndclass_windows.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index 276e698..d57cc20 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -19,9 +19,18 @@ var ( ) var ( - defWindowProc = user32.NewProc("DefWindowProcW") + _defWindowProc = user32.NewProc("DefWindowProcW") ) +func defWindowProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { + r1, _, _ := _defWindowProc.Call( + uintptr(hwnd), + uintptr(uMsg), + uintptr(wParam), + uintptr(lParam)) + return _LRESULT(r1) +} + func stdWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { return func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { switch uMsg { @@ -62,12 +71,7 @@ func stdWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam s.signal() return 0 default: - r1, _, _ := defWindowProc.Call( - uintptr(hwnd), - uintptr(uMsg), - uintptr(wParam), - uintptr(lParam)) - return _LRESULT(r1) + return defWindowProc(hwnd, uMsg, wParam, lParam) } panic(fmt.Sprintf("stdWndProc message %d did not return: internal bug in ui library", uMsg)) } |
