win api, c++, minimum resize dimensions?

  • Bozebo
  • Expert
  • Expert
  • User avatar
  • Joined: Feb 15, 2006
  • Posts: 709
  • Loc: 404
  • Status: Offline

Post April 22nd, 2010, 10:56 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 22nd, 2010, 10:56 am

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6129
  • Loc: Seattle, WA
  • Status: Offline

Post April 26th, 2010, 3:48 pm

That truly is odd. Can you set a breakpoint and examine the actual type/value of lParam?
The Beer Monocle. Classy.
  • X3ndou
  • Proficient
  • Proficient
  • User avatar
  • Joined: Nov 06, 2004
  • Posts: 263
  • Loc: New Jersey
  • Status: Offline

Post April 30th, 2010, 8:19 pm

Try casting lParam as a MAXMININFO struct. Also do what spork said.
"On the day *I* go to work for Microsoft, faint oinking sounds will be heard from far overhead, the moon will not merely turn blue but develop polkadots, and hell will freeze over so solid the brimstone will go superconductive." -Eric S. Raymond

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 208 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.