How to limit Window Resizing

Just starting out? Need help? Post your questions and find answers here.
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

How to limit Window Resizing

Post by naw »

Hi

Is there a way to allow a window to resize only vertically or only horizontally.
I'm doing it a rather ugly way (see code below) which works but the effect is a bit wierd...

Code: Select all

   OpenWindow(0, 150, 130, 530, 350, "", #PB_Window_SizeGadget)
   Repeat
    _eventId=WaitWindowEvent()
    ResizeWindow(0,#PB_Ignore,#PB_Ignore, 530,#PB_Ignore)
  Until _eventId=#PB_Event_CloseWindow
Ta - N
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

The message #WM_GETMINMAXINFO is sent whenever the size of a window is about to change. The lparam value of this message contains a pointer to a MINMAXINFO structure containing min/max specs. This message and pointer are sent for the express purpose of enabling programs to alter this information to suit the needs of the application. Here's a thread where there are some examples shown:

http://www.purebasic.fr/english/viewtop ... ght=resize
BERESHEIT
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

Post by naw »

Hey thanks netmaestro - thats exactly what I wanted :-)
Ta - N
Post Reply