I'm trying my hand at writing an MDI application, and have an issue of conflicting information. In the code below:
Code:
LRESULT CALLBACK MdiChildWndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)
{
RECT hwndRect;
SCROLLINFO si;
HWND hwndThis;
int nScrollCode, clientrange, disenabler, ScrollFlag;
register int ii, jj, nPos, newPos, lowest, width, height;
static char namework[51];
switch(msg)
{
...
...
case WM_SIZE:
hwndThis = (HWND)SendMessage(hwndMDIClient, WM_MDIGETACTIVE, (WPARAM)0, (LPARAM)(BOOL)NULL); // This window
switch (wparam)
{
case SIZE_MINIMIZED:
case SIZE_RESTORED:
case SIZE_MAXIMIZED:
width = (int)LOWORD(lparam);
height = (int)HIWORD(lparam);
si.cbSize = sizeof(si);
si.fMask = SIF_PAGE; // Only page needs amending
si.nPage = height; // Set page size to height of client area
SetScrollInfo(hwnd, SB_VERT, &si, TRUE); // Redraw the vertical scrollbar
si.nPage = width; // Set page width to width of client area
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE); // Redraw the horizontal scrollbar
// return 0; // Should return zero, but doing so messes up the MDI stuff
break;
default:
break;
}
UpdateWindow(hwndThis);
break;
...
...
}
return DefMDIChildProc(hwnd, msg, wparam, lparam);
}
If I return zero, then I experience the exact same problem as described in this thread here.
However, the documentation says that an "application should return zero if it processes this message."
So my question is, Which is correct? Should I return zero or lett it fall though to DefMDIChildProc()?
Thanks.