Wm_windowposchanging

A resizable window on Win32 (with the title hacked out) resizes down to
about 4x4 pixels! Hard to get resized out of that… (not sure how small
it goes with the title bar)

I added this to the wincommon/SDL_sysevents.c to not let the window go
smaller than 256x256. Perhaps something similar (maybe a smaller minimum?)
is a generally useful addition?

case WM_WINDOWPOSCHANGING:
{
WINDOWPOS* pos=(WINDOWPOS*)lParam;
if(pos->cx < 256) pos->cx = 256;
if(pos->cy < 256) pos->cy = 256;
}
break;

A resizable window on Win32 (with the title hacked out) resizes down to
about 4x4 pixels! Hard to get resized out of that… (not sure how small
it goes with the title bar)

I added this to the wincommon/SDL_sysevents.c to not let the window go
smaller than 256x256. Perhaps something similar (maybe a smaller minimum?)
is a generally useful addition?

case WM_WINDOWPOSCHANGING:
{
WINDOWPOS* pos=(WINDOWPOS*)lParam;
if(pos->cx < 256) pos->cx = 256;
if(pos->cy < 256) pos->cy = 256;
}
break;

I regularly resize windows down to 16x16.
Is there any reason to limit it?

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Well, the disturbing thing was it went down to virtually nothing. I
thought it was stuck, but it turned out dragging up and right grew it
back. I can just see it freaking out a customer, especially since we save
the previous window size… (Though we do some safety checking on the next
run). Anyway, I added it for our stuff just to keep folks from getting
themselves into trouble.

As a general suggestion, if this were to be added to SDL, perhaps something
like a function call or two to hint minimum and maximum window sizes would
be a good way to implement it, with a default of no
limit. SDL_WM_MinSizeHint or somesuch.

Then, too, it just now occurs to me I could insert a WndProc with
SetWindowLong and watch for the message without hacking the dll as I
did. sigh. Always doing things the hard way. :slight_smile:

–Manny

At 10:18 PM 10/22/2000 -0700, you wrote:

I regularly resize windows down to 16x16.
Is there any reason to limit it?

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Well, the disturbing thing was it went down to virtually nothing. I
thought it was stuck, but it turned out dragging up and right grew it
back. I can just see it freaking out a customer, especially since we save
the previous window size… (Though we do some safety checking on the next
run). Anyway, I added it for our stuff just to keep folks from getting
themselves into trouble.

As a general suggestion, if this were to be added to SDL, perhaps something
like a function call or two to hint minimum and maximum window sizes would
be a good way to implement it, with a default of no
limit. SDL_WM_MinSizeHint or somesuch.

Then, too, it just now occurs to me I could insert a WndProc with
SetWindowLong and watch for the message without hacking the dll as I
did. sigh. Always doing things the hard way. :slight_smile:

–Manny

At 10:18 PM 10/22/2000 -0700, you wrote:>I regularly resize windows down to 16x16.

Is there any reason to limit it?

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software