سؤال

I'm coding an MFC application that needs to allow vertical window resizing and prevent horizontal resizing. What's the simplest way to do this?

هل كانت مفيدة؟

المحلول

You want to catch WM_SIZING and WM_GETMINMAXINFO to force the proper width, (WM_NCHITTEST to filter out any responses leading to the user trying to change the width (Might not be needed...)).

If there were no multi-monitor setups, WM_GETMINMAXINFO alone would suffice.

Also take a look at GetSystemMenu(), for possibly tailoring your system menu.

BTW: This answer is not MFC-specific.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top