Added window minimum sizes.

This commit is contained in:
Pietro Gagliardi 2014-02-11 07:50:00 -05:00
parent 07f92bb8d9
commit 6ae39f57a2
2 changed files with 17 additions and 0 deletions

View File

@ -87,6 +87,11 @@ func wndProc(hwnd HWND, msg uint32, wParam WPARAM, lParam LPARAM) LRESULT {
MB_OK)
}
return 0
case WM_GETMINMAXINFO:
mm := lParam.MINMAXINFO()
mm.PtMinTrackSize.X = 320
mm.PtMinTrackSize.Y = 240
return 0
case WM_CLOSE:
err := DestroyWindow(hwnd)
if err != nil {

View File

@ -306,3 +306,15 @@ const (
WM_WINDOWPOSCHANGED = 0x0047
WM_WINDOWPOSCHANGING = 0x0046
)
type MINMAXINFO struct {
PtReserved POINT
PtMaxSize POINT
PtMaxPosition POINT
PtMinTrackSize POINT
PtMaxTrackSize POINT
}
func (l LPARAM) MINMAXINFO() *MINMAXINFO {
return (*MINMAXINFO)(unsafe.Pointer(l))
}