summaryrefslogtreecommitdiff
path: root/redo
diff options
context:
space:
mode:
Diffstat (limited to 'redo')
-rw-r--r--redo/funcnames_windows.go1
-rw-r--r--redo/window_windows.go9
2 files changed, 10 insertions, 0 deletions
diff --git a/redo/funcnames_windows.go b/redo/funcnames_windows.go
index 9724b9a..1309881 100644
--- a/redo/funcnames_windows.go
+++ b/redo/funcnames_windows.go
@@ -27,3 +27,4 @@ package ui
// wfunc user32 UpdateWindow uintptr uintptr
// wfunc user32 DestroyWindow uintptr uintptr
// wfunc user32 PostQuitMessage uintptr void
+// wfunc user32 GetClientRect uintptr *s_RECT uintptr
diff --git a/redo/window_windows.go b/redo/window_windows.go
index f2e8951..f09ba3b 100644
--- a/redo/window_windows.go
+++ b/redo/window_windows.go
@@ -165,6 +165,15 @@ func windowWndProc(hwnd uintptr, msg t_UINT, wParam t_WPARAM, lParam t_LPARAM) t
return f_DefWindowProcW(hwnd, msg, wParam, lParam)
}
switch msg {
+ case c_WM_SIZE:
+ var r s_RECT
+
+ res, err := f_GetClientRect(w.hwnd, &r)
+ if res == 0 {
+ panic(fmt.Errorf("error getting client rect for Window in WM_SIZE: %v", err))
+ }
+ fmt.Printf("new size %d x %d\n", r.right - r.left, r.bottom - r.top)
+ return 0
case c_WM_CLOSE:
close := w.closing.fire()
if close {