From c543f5639b121bcdae11f681466c030394902f65 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 30 May 2014 14:13:47 -0400 Subject: 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. --- stdwndclass_windows.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'stdwndclass_windows.go') 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)) } -- cgit v1.2.3