예제 #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
}