Archived

This topic is now archived and is closed to further replies.

Windows layout

This topic is 5151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here try this:


LRESULT CALLBACK window_proc
(
HWND window_handle,
UINT message_id,
WPARAM word_param,
LPARAM long_param
)
{
static SIZE min_size = { /* you know what goes here };

switch ( message_id )
{

// window procedure stuff here...


case WM_SIZING:

if ( ((RECT*)long_param)->right < min_width )
{
((RECT*)long_param)->right = min_size.cx;
}

if ( ((RECT*)long_param)->bottom < min_height )
{
((RECT*)long_param)->bottom = min_size.cy;
}

// more window procedure stuff here...


default:

return DefWindowProc ( window_handle, message_id, word_param, long_param );

}


EDIT: ok, got the bugs worked out.

[edited by - microdot on November 9, 2003 4:48:24 AM]

Share this post


Link to post
Share on other sites
WM_GETMINMAXINFO will give you the pointer to a structure.
Just fill in the wanted params and return zero (like the docs say).
Don''t use SetWindowPos or any other sizing command in the proc. Windows will take care of the sizing by itself.

Share this post


Link to post
Share on other sites