Original Post
I am working on an OpenGL application which I am going to use as a general sandbox to make a basic framework. There are a lot of things to handle, and one of them is resizing the window. I have everything working brilliantly, except minimum resize dimensions. According to this page on the msdn, it should not be a difficult task. So I went ahead and worked on my WndProc function to work out a solution.
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
}
}
According to the msdn, lParam will be a pointer to a MINMAXINFO structure, of which I can edit the ptMinTrackSize point structure and so create nice minimum dimensions for the window. But, lParam is not a pointer according to the compiler, yet msdn says clearly that it is a "Pointer to a MINMAXINFO structure..." I tried a few other things which didn't work but the code above is the best way I can present the issue. I can't find any examples of minimum dimensions which are not visual basic or some other rubbish. So what is the solution to get around Microsoft's bad documentation? Thanks [Edited by - Bozebo on April 23, 2010 6:55:52 AM]