first go at some notepad changes

Dmitry Timoshkov dmitry at baikal.ru
Sun Jul 27 22:01:50 CDT 2003


"Jonathan Wilson" <jonwil at 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





More information about the wine-devel mailing list