From b13453ad9e9aa20b6fca064f8b185b0ea86e5aaf Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 30 May 2014 23:28:41 -0400 Subject: Changed storeSysData() on Windows to write the HWND to the sysData structure there. This will be important for removing some of the TODOs from areaWndProc(). --- stdwndclass_windows.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stdwndclass_windows.go') diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index c90bb92..3c189a7 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -60,7 +60,9 @@ func storeSysData(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRES cs := (*uintptr)(unsafe.Pointer(lParam)) saddr := *cs setWindowLongPtr(hwnd, negConst(_GWLP_USERDATA), saddr) - // don't set s; we return here + // also set s.hwnd here so it can be used by other window messages right away + s := (*sysData)(unsafe.Pointer(saddr)) + s.hwnd = hwnd } // TODO is this correct for WM_NCCREATE? I think the above link does it but I'm not entirely sure... return defWindowProc(hwnd, uMsg, wParam, lParam) -- cgit v1.2.3