#include ONCE "window9.bi"

sub WindowBounds(hw as HWND , MinimalWidth  as long, MinimalHeight  as long, MaximalWidth  as long, MaximalHeight  as long) export	
	
	dim as GdkGeometry hints
	
	dim as gint iCaption , iBorder
	
	UpdateinfoxServer		
	
	GetWindowsCaptionBorderSize( hw , @iCaption , @iBorder)
	
	hints.min_width = MinimalWidth - 2*iBorder
	
	hints.min_height = MinimalHeight - (2*iBorder + iCaption)
	
	hints.max_width = MaximalWidth - 2*iBorder
	
	hints.max_height = MaximalHeight - (2*iBorder + iCaption)
	
	if hints.min_width < 1 then hints.min_width = MinimalWidth
	
	if hints.min_height < 1 then hints.min_height = MinimalHeight
	
	if hints.max_width < 1 then hints.max_width = MaximalWidth
	
	if hints.max_height < 1 then hints.max_height = MaximalHeight
	
	gtk_window_set_geometry_hints (GTK_WINDOW (hw),_
		hw,_
		@hints,GDK_HINT_MIN_SIZE or GDK_HINT_MAX_SIZE)	
	
End Sub