示例#1
0
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)
	}
}
示例#2
0
文件: main.go 项目: saintfish/d2d
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)
}
示例#3
0
func (this *Window) FlushImage() {
	w32.InvalidateRect(this.hwnd, nil, false)
	w32.UpdateWindow(this.hwnd)
}
示例#4
0
文件: window.go 项目: js-arias/sparta
// Update updates the window content.
func (win *window) Update() {
	w32.InvalidateRect(win.id, nil, true)
}