Jump to content
  • Advertisement

Archived

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

encom

Windows layout

This topic is 5457 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

Hi I make win32 layout (win32 sdk) and i want to know how to stop the window resizing event. (when window reach the min size) thanks

Share this post


Link to post
Share on other sites
Advertisement
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
sorry, it doesnt work !
after the WM_GETMINMAXINFO message, i use
SetWindowPos(hwnd, 0, 0, 0, minW, minH, SWP_NOMOVE | SWP_NOZORDER);

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!