fix displaying status bar when notepad was resized

bug report by Apal
patch by Apal && w3seek
fixes bug 1625

svn path=/trunk/; revision=22660
This commit is contained in:
Johannes Anderwald 2006-06-27 10:02:33 +00:00
parent 4903b28f61
commit 94ad288b3c

View file

@ -341,9 +341,33 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
break;
case WM_SIZE:
SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam),
SWP_NOOWNERZORDER | SWP_NOZORDER);
{
if (Globals.bShowStatusBar)
{
RECT rcStatusBar;
HDWP hdwp;
if (!GetWindowRect(Globals.hStatusBar, &rcStatusBar))
break;
hdwp = BeginDeferWindowPos(2);
if (hdwp == NULL)
break;
hdwp = DeferWindowPos(hdwp, Globals.hEdit, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam) - (rcStatusBar.bottom - rcStatusBar.top), SWP_NOZORDER | SWP_NOMOVE);
if (hdwp == NULL)
break;
hdwp = DeferWindowPos(hdwp, Globals.hStatusBar, NULL, 0, 0, LOWORD(lParam), LOWORD(wParam), SWP_NOZORDER);
if (hdwp != NULL)
EndDeferWindowPos(hdwp);
}
else
SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), SWP_NOZORDER | SWP_NOMOVE);
break;
}
case WM_SETFOCUS:
SetFocus(Globals.hEdit);