Is it possible in a windows message handler for WM_SIZE to detect if the current size change is triggered by a user action (such as resizing by mouse or through system menu+keyboard)?
(Currently I'm setting/resetting a flag whether the resize is "because of my code" but this is quite unwieldy in some cases)
[edit] use case:
The purpose is to distinguish "the size user sets" from size changes triggered by other operations (also in control of the user).
In this particular case, I have a property sheet control where each page has a different minimum/default size.
The expected user behavior is as follows:
- the minimum size of the sheet is no smaller than required by the current page (i.e. it changes when the page changes)
- if the user sizes the sheet to "as small as possible" then switches to another page, it should be sized to "as small as possible for that page", too.
(informal first level usability testing - i.e. me toying around with it - has shown that this "use smalles size" is better tracked separately for X and Y)
Yes, this leads to sheet size jumping when page is changed. This is unfortunate but better than alternatives in this particular application.
In this case, Aero docking isn't supported for that wind since it's not top-level.
FWIW, having change messages fire always consistently for all controls, and having an indicator if this was triggered by a user action or programmatically ranks pretty high on my list of "essential for a UI control API".