win api, c++, minimum resize dimensions?

  • Bozebo
  • Expert
  • Expert
  • User avatar
  • Posts: 709
  • Loc: 404

Post 3+ Months Ago

OK, I am trying to make my application only allow a certain minimum width and height.

According to these 2 pages on the msdn:
http://msdn.microsoft.com/en-us/library/ms632626%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/ms632605%28v=VS.85%29.aspx

Quote:
lParam

Pointer to a MINMAXINFO structure


My code (placed within my WndProc function) is correct:
C Code: [ Select ]
case WM_GETMINMAXINFO: //window size/position is going to change
  lParam->ptMinTrackSize.x = (long)windowMinWidth; //apply custom min width/height
  lParam->ptMinTrackSize.y = (long)windowMinHeight;
  return 0;
 
  1. case WM_GETMINMAXINFO: //window size/position is going to change
  2.   lParam->ptMinTrackSize.x = (long)windowMinWidth; //apply custom min width/height
  3.   lParam->ptMinTrackSize.y = (long)windowMinHeight;
  4.   return 0;
  5.  


Strangely, I get an error "base operand of '->' is not a pointer" for the 2 lines in question.
According to the msdn, lParam is a pointer in this scenario.

I have tried a few solutions involving the MINMAXINFO structure but they are always worse ideas and have worse compilation errors that the solution which the msdn seems to make obvious.

So why do Microsoft always lie in the msdn? I have had several ongoing issues in programming for the windows api because the documentation is so flawed. It always takes the mind of an experienced windows api programmer to set me right, what is the solution for Microsoft's fail this time?
/rant

Thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6241
  • Loc: Seattle, WA

Post 3+ Months Ago

That truly is odd. Can you set a breakpoint and examine the actual type/value of lParam?
  • X3ndou
  • Proficient
  • Proficient
  • User avatar
  • Posts: 263
  • Loc: New Jersey

Post 3+ Months Ago

Try casting lParam as a MAXMININFO struct. Also do what spork said.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 51 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.