Esempio n. 1
0
func (this *PushButton) WndProc(msg uint, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.BN_CLICKED:
		println("Clicked")
	case w32.WM_LBUTTONDOWN:
		w32.SetCapture(this.Handle())
	case w32.WM_LBUTTONUP:
		w32.ReleaseCapture()
	}

	return this.W32Control.WndProc(msg, wparam, lparam)
}
Esempio n. 2
0
func (this *Form) WndProc(msg uint, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_LBUTTONDOWN:
		if this.isDragMove {
			w32.ReleaseCapture()
			w32.SendMessage(this.hwnd, w32.WM_NCLBUTTONDOWN, w32.HTCAPTION, 0)
		}
	case w32.WM_CLOSE:
		w32.DestroyWindow(this.hwnd)
	case w32.WM_DESTROY:
		w32.PostQuitMessage(0)
	}

	return w32.DefWindowProc(this.hwnd, msg, wparam, lparam)
}
Esempio n. 3
0
func (this *Form) WndProc(msg uint, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_LBUTTONDOWN:
		if this.isDragMove {
			w32.ReleaseCapture()
			w32.SendMessage(this.hwnd, w32.WM_NCLBUTTONDOWN, w32.HTCAPTION, 0)
		}
	case w32.WM_CLOSE:
		this.onClose.Fire(NewEventArg(this, nil))
		return 0
	case w32.WM_DESTROY:
		w32.PostQuitMessage(0)
		return 0
	}
	return w32.DefWindowProc(this.hwnd, uint32(msg), wparam, lparam)
}