Advertisement

first time poster with a windows programming question.

Started by March 10, 2001 07:12 PM
4 comments, last by Mucman 23 years, 11 months ago
First off I would like to say how great this forum is! I have been looking for a site like thise for a while now. I know for sure that I will be spending a lot of time here! My question is probably a simple one, but the answer has eluded me from the texts I have been reading and from the net... I am using VC++ 6 and I am making a very basic app. I want to be able to assign a minimum size to the window and if the user trys to make it smaller than that, I want the window to go to its minimum size. I have only been learning windows progamming for about a week so please be patient if your solutions seem too complex to me at first. thanks Mucman "You don''''t get wise with the sleep still in your eyes." - Neil Peart
"You won't get wise with the sleep still in your eyes." - Neil Peart
MFC or Win32 API?
Either way you need to handle the WM_SIZE event, and change the event data to goto the minimum size if they try to change it smaller.

There may be a more elegant way, but that will work.

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
  		case WM_GETMINMAXINFO:		{	LPMINMAXINFO pmmi = (LPMINMAXINFO) lParam;			pmmi->ptMinTrackSize.x = 256;			pmmi->ptMinTrackSize.y = 128;			return 0;		}  



Sorry, I forgot to mention it was for the win32 API

Here is a portion of my code :

case WM_SIZE :
Width = LOWORD(lParam) ;
Height = HIWORD(lParam) ;

GetClientRect (hwnd, ▭) ;

if ( Width < 200 || Height < 200 )
{

}

InvalidateRect(hwnd, NULL, FALSE);

return 0;

I don''t know what attributes I have to modify... am I changing the attributes of hwnd? or rect? Or am I way off?

thanks for the quick reply btw!!!

"You don''''t get wise with the sleep still in your eyes." - Neil Peart
"You won't get wise with the sleep still in your eyes." - Neil Peart
You snuck that in while I was posting baskuenen!

Does WM_GETMINMAXINFO get called anytime the window size is changed?



"You won't get wise with the sleep still in your eyes." - Neil Peart
yep edidoda (must be the vodka - sorry bout that)

This topic is closed to new replies.

Advertisement