示例#1
0
文件: wndproc.go 项目: hoperuin/gform
func genMouseEventArg(wparam, lparam uintptr) *MouseEventData {
	var data MouseEventData
	data.Button = int(wparam)
	data.X = int(w32.LOWORD(uint(lparam)))
	data.Y = int(w32.HIWORD(uint(lparam)))

	return &data
}
示例#2
0
文件: edit.go 项目: hoperuin/gform
func (this *Edit) WndProc(msg uint, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_COMMAND:
		switch w32.HIWORD(uint(wparam)) {
		case w32.EN_CHANGE:
			this.onChange.Fire(NewEventArg(this, nil))
		}
	}

	return this.W32Control.WndProc(msg, wparam, lparam)
}
示例#3
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)
}
示例#4
0
func genPoint(p uintptr) (x, y int) {
	x = int(w32.LOWORD(uint32(p)))
	y = int(w32.HIWORD(uint32(p)))
	return
}