Enforcing Window Minimum Size

forum.advanced.programming (1998-2005)
Damien Boucquey

Enforcing Window Minimum Size

Post by Damien Boucquey » 03 Feb 2005, 23:45

 Posted by:  Damien Boucquey 

Hi there,

Is there a way to set a minimum size for a form window, so that the resizing
stops if we try to make it smaller than a given initial dimension ?

Thanks in advance,

Damien

Jürg Niederberger

Enforcing Window Minimum Size

Post by Jürg Niederberger » 04 Feb 2005, 07:50

 Posted by:  Jürg Niederberger 

Quick n dirty:

On WM_Size ( = 5)
restore size if it is too small.

Jürg

g.achrainer

Enforcing Window Minimum Size

Post by g.achrainer » 04 Feb 2005, 09:53

 Posted by:  g.achrainer 

Hi,

use WM_SIZING (see MSDN for further details), modify the RECT structure that
comes with lParam using the CStruct... functions contained in
"CStructL.apl".

Regards,

gerhard.

Ricardo

Enforcing Window Minimum Size

Post by Ricardo » 04 Feb 2005, 14:11

 Posted by:  Ricardo 

Try this sample

Attachment: sizing Define tamanho minimo e maximo do form.apt

Check Abdoul

Enforcing Window Minimum Size

Post by Check Abdoul » 04 Feb 2005, 18:48

 Posted by:  CheckAbdoul 

You should handle the WM_GETMINMAXINFO and set the minimum and maximum
positions of the window. See the following KB article for an example MFC
code.

http://support.microsoft.com/?id=133256

--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

Catalin Enache

Enforcing Window Minimum Size

Post by Catalin Enache » 04 Feb 2005, 19:34

 Posted by:  Catalin Enache 

See atached sample.
Catalin

Attachment: resize.apt

Christian Astor

Enforcing Window Minimum Size

Post by Christian Astor » 05 Feb 2005, 05:40

 Posted by:  Christian ASTOR 


Yes, it's the standard way... but I always needed a DLL to catch it.
Otherwise, as others said, WM_SIZING also works.

Check Abdoul

Enforcing Window Minimum Size

Post by Check Abdoul » 07 Feb 2005, 18:13

 Posted by:  CheckAbdoul 

Thanks for the clarification Christian.

--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

Return to “advanced.programming”

Who is online

Users browsing this forum: [Ccbot] and 0 guests