From cfb9bcc625b26191f10303344d21450ba4c9c68c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 12 Jul 2014 12:59:12 -0400 Subject: [PATCH] Fixed the Windows code. Now to implement closing properly. --- redo/uitask_windows.go | 2 +- redo/window_windows.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/redo/uitask_windows.go b/redo/uitask_windows.go index 0c43f36..1d509c1 100644 --- a/redo/uitask_windows.go +++ b/redo/uitask_windows.go @@ -47,7 +47,7 @@ func uimsgloop() { func issue(req *Request) { res, err := f_PostMessageW( - hNULL, // TODO + msgwin, msgRequest, 0, t_LPARAM(uintptr(unsafe.Pointer(req)))) diff --git a/redo/window_windows.go b/redo/window_windows.go index aba3232..4406704 100644 --- a/redo/window_windows.go +++ b/redo/window_windows.go @@ -46,7 +46,7 @@ func newWindow(title string, width int, height int) *Request { 0, windowclassptr, syscall.StringToUTF16Ptr(title), - c_WS_OVERLAPPED, + c_WS_OVERLAPPEDWINDOW, c_CW_USEDEFAULT, c_CW_USEDEFAULT, uintptr(width), uintptr(height), hNULL, hNULL, hInstance, unsafe.Pointer(w)) @@ -151,6 +151,8 @@ func windowWndProc(hwnd uintptr, msg t_UINT, wParam t_WPARAM, lParam t_LPARAM) t // the lpParam is available during WM_NCCREATE and WM_CREATE if msg == c_WM_NCCREATE { storelpParam(hwnd, lParam) + w := (*window)(unsafe.Pointer(f_GetWindowLongPtrW(hwnd, c_GWLP_USERDATA))) + w.hwnd = hwnd } // act as if we're not ready yet, even during WM_NCCREATE (nothing important to the switch statement below happens here anyway) return f_DefWindowProcW(hwnd, msg, wParam, lParam)