func (this *ControlBase) Invalidate(erase bool) { pRect := w32.GetClientRect(this.hwnd) if this.isForm { w32.InvalidateRect(this.hwnd, pRect, erase) } else { rc := ScreenToClientRect(this.hwnd, pRect) w32.InvalidateRect(this.hwnd, rc.GetW32Rect(), erase) } }
func (app *DemoApp) WndProc(hwnd w32.HWND, msg uint, wParam, lParam uintptr) uintptr { if hwnd != app.hwnd { return w32.DefWindowProc(hwnd, msg, wParam, lParam) } switch msg { case w32.WM_SIZE: width := w32.LOWORD(uint(lParam)) height := w32.HIWORD(uint(lParam)) app.OnResize(width, height) return 0 case w32.WM_DISPLAYCHANGE: w32.InvalidateRect(app.hwnd, nil, false) return 0 case w32.WM_PAINT: app.OnRender() w32.ValidateRect(app.hwnd, nil) return 0 case w32.WM_DESTROY: w32.PostQuitMessage(0) return 1 } return w32.DefWindowProc(hwnd, msg, wParam, lParam) }
func (this *Window) FlushImage() { w32.InvalidateRect(this.hwnd, nil, false) w32.UpdateWindow(this.hwnd) }
// Update updates the window content. func (win *window) Update() { w32.InvalidateRect(win.id, nil, true) }