"Jonathan Wilson" <jonwil(a)tpgi.com.au> wrote:
+VOID DIALOG_ShowStatusBar(VOID) +{ + RECT rcs; + RECT rc; + GetClientRect(Globals.hMainWnd, &rc); + Globals.bStatusBarEnabled = !Globals.bStatusBarEnabled; + if (Globals.bStatusBarEnabled == TRUE) + { + ShowWindow(Globals.hStatusBar,SW_SHOW); + GetClientRect(Globals.hStatusBar,&rcs); + Globals.iStatusBarHeight = rcs.bottom - rcs.top; + SendMessage(Globals.hStatusBar, WM_SIZE, 0, 0);
case WM_SIZE: - SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), + SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), (HIWORD(lParam)-Globals.iStatusBarHeight), SWP_NOOWNERZORDER | SWP_NOZORDER); + if (Globals.bStatusBarEnabled == TRUE) + { + SendMessage(Globals.hStatusBar, WM_SIZE, 0, 0); + }
Do not send bogus WM_SIZE messages, use SetWindowPos instead. Remove iStatusBarHeight from globals and use IsWindowVisible and GetWindowRect when you need to take into account status bar size. -- Dmitry