Hi, I am working on a Windows application to play about with OpenGL.
Thats not where the issue lies however...
I want my app to be resizable, which isn't hard to achieve. But implementing minimum resize dimensions (to make the application layout easy to create etc) seems to be a bit of a bother.
This page on the msdn seems to be what I am looking for.
So I hopped into my WndProc function and started working on some code:
So, the msdn says that lParam for this event will be a pointer to a MINMAXINFO structure, which among other values, contains a point structure called ptMinTrackSize. The idea is that changing these values before windows takes the structure stops the user from resizing it below your allowable dimensions.
But lParam is simply not a pointer, my compiler says. And I agree, so why does msdn say it is? And why can't I find an example or tutorial for this anywhere? I have searched gamedev.net where these solutions usually lie but nobody seems to have asked before.
As is usual with Windows programming, I need somebody who has overcome the situation before to answer this query - because Microsoft don't seem to bother documenting their development software properly (I think they want people using the high-level bloatware applications which handle this for the programmer).
Any help is greatly appreciated.
Thats not where the issue lies however...
I want my app to be resizable, which isn't hard to achieve. But implementing minimum resize dimensions (to make the application layout easy to create etc) seems to be a bit of a bother.
This page on the msdn seems to be what I am looking for.
So I hopped into my WndProc function and started working on some code:
Code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
switch(message){
case WM_GETMINMAXINFO: //window size/position is going to change
/*
Intercept lParam pointer to MINMAXINFO structure and apply custom
dimensions
*/
lParam->ptMinTrackSize.x = (long)windowMinWidth;
lParam->ptMinTrackSize.y = (long)windowMinHeight;
return 0;
//other cases excluded
}
}
So, the msdn says that lParam for this event will be a pointer to a MINMAXINFO structure, which among other values, contains a point structure called ptMinTrackSize. The idea is that changing these values before windows takes the structure stops the user from resizing it below your allowable dimensions.
But lParam is simply not a pointer, my compiler says. And I agree, so why does msdn say it is? And why can't I find an example or tutorial for this anywhere? I have searched gamedev.net where these solutions usually lie but nobody seems to have asked before.
As is usual with Windows programming, I need somebody who has overcome the situation before to answer this query - because Microsoft don't seem to bother documenting their development software properly (I think they want people using the high-level bloatware applications which handle this for the programmer).
Any help is greatly appreciated.