0

I am currently working on a piece of code to circumvent the modal loops for moving and resizing Windows by effectively re-implementing DefWindowProc for the process.

The first snag I've hit is with MINMAXINFO. It seems that Windows fills this in with default values before sending the message along to the WindowProc, so simply sending the message to a window that doesn't override the values wouldn't do any good. Figuring that this wouldn't be as simple as giving it the desktop window size for the max and zeroes for the min, I checked how ReactOS does it in their source and.... well, I don't understand why they do the things they do in calculating it.

In particular, they choose to negate the WS_BORDER style when calling AdjustWindowRectEx. Their use of variables named "xinc" and "yinc" also seems unusual to me.

Basically, I'm hoping someone who has worked with the code (or MINMAXINFO more generally) can explain what I'm missing.ReactOS: WinPosGetMinMaxInfo

nfries88
  • 374
  • 6
  • 7

1 Answers1

-1

The ptMaxSize values in the MINMAXINFO structure are not the maximum size you can drag size to, but what the size will be if the window is actually maximized. When a window is maximized, the thick border is removed (since you no longer want the user to grab the border and try to resize it).

Make sure you read all the details in the explanation of the values for MINMAXINFO.

Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
  • 1
    I know what the members are for, I just didn't think that maximizing would remove the border (I say while typing into a maximized window). The use of xinc and yinc in setting ptMinTrackSize for non-captioned windows still confuses me. It appears that the values would probably be negative. – nfries88 Jan 18 '14 at 18:17
  • down vote because, the question was what are the defaults, not what members mean. – metablaster Oct 20 '19 at 13:10
  • The "Figuring that this wouldn't be as simple as giving it the desktop window size for the max and zeroes for the min" seemed to suggest that the OP was confused about what the fields meant. The linked ReactOS code seems pretty clear if you understand the meaning of the fields it computes. – Adrian McCarthy Oct 21 '19 at 20:20