P
Pierre Arnaud
Hello,
I have come across a problem for which I don't see any solution
in the managed world. Here is the simplest way to reproduce it :
- Create a Form with a MinimumSize set to 100 x 100.
- When the ResizeBegin event is fired, change the MinimumSize
to 50 x 50.
As soon as I start dragging the right side of my form, I'd expect
the new MinimumSize to become active, yet Windows somehow keeps
track of the original MinimumSize : I cannot reduce the size of
my window below 100 x 100.
Checking with SPY++, I see that the Form properly reports an
updated MinimumSize when the WM_GETMINMAXINFO event gets fired :
- WM_MOUSEMOVE
- WM_SIZING
- WM_WINDOWPOSCHANGING
- WM_GETMINMAXINFO
- WM_NCCALCSIZE
- WM_NCPAINT
....
- WM_WINDOWPOSCHANGED
- WM_SIZE
...
Yet, as soon as I move to far to the left (where Width would
become less than 100 pixels wide), I only get a tight loop of :
- WM_MOUSEMOVE
- WM_SIZING
And WM_SIZING no longer changes.
Is this by design ?
I expected to be able to change the minimum size on the fly
(in my real application, I need to update it based on the
new window size, as the window contents rearranges itself,
the minimum can become smaller than what I had first assumed).
Is there any way to make my scenario work ? Even dirty WndProc
tricks will do, as long as I can make Windows forget about the
initial reply to WM_GETMINMAXINFO !
Pierre
Author of Creative Docs .NET -- http://www.creativedocs.net/
I have come across a problem for which I don't see any solution
in the managed world. Here is the simplest way to reproduce it :
- Create a Form with a MinimumSize set to 100 x 100.
- When the ResizeBegin event is fired, change the MinimumSize
to 50 x 50.
As soon as I start dragging the right side of my form, I'd expect
the new MinimumSize to become active, yet Windows somehow keeps
track of the original MinimumSize : I cannot reduce the size of
my window below 100 x 100.
Checking with SPY++, I see that the Form properly reports an
updated MinimumSize when the WM_GETMINMAXINFO event gets fired :
- WM_MOUSEMOVE
- WM_SIZING
- WM_WINDOWPOSCHANGING
- WM_GETMINMAXINFO
- WM_NCCALCSIZE
- WM_NCPAINT
....
- WM_WINDOWPOSCHANGED
- WM_SIZE
...
Yet, as soon as I move to far to the left (where Width would
become less than 100 pixels wide), I only get a tight loop of :
- WM_MOUSEMOVE
- WM_SIZING
And WM_SIZING no longer changes.
Is this by design ?
I expected to be able to change the minimum size on the fly
(in my real application, I need to update it based on the
new window size, as the window contents rearranges itself,
the minimum can become smaller than what I had first assumed).
Is there any way to make my scenario work ? Even dirty WndProc
tricks will do, as long as I can make Windows forget about the
initial reply to WM_GETMINMAXINFO !
Pierre
Author of Creative Docs .NET -- http://www.creativedocs.net/