Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-13018

regedit.exe and user32.dll DeferWindowPos(...)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None

    Description

      1) Let start regedit.exe, point the mouse to the right area "ListView", press left button and move mouse. It draws some figure regedit1.png.

      2) Now modify ReactOS\base\applications\regedit\childwnd.c to specify RED background color (childwnd.c.2):

      . . .
      static void OnPaint(HWND hWnd)
      {
       PAINTSTRUCT ps;
       RECT rt;
       
      HBRUSH hbrush;
       
      GetClientRect(hWnd, &rt);
       BeginPaint(hWnd, &ps);
      /* FillRect(ps.hdc, &rt, GetSysColorBrush(COLOR_BTNFACE)); */
       hbrush = CreateSolidBrush (RGB (0xFF, 0x00, 0x00));
       FillRect (ps.hdc, &rt, hbrush);
       DeleteObject (hbrush);
       EndPaint(hWnd, &ps);
      }
      . . .

      Rebuild regedit.exe and start it again. We get figure regedit2.png.

      3) Now modify "childwnd.c" again: only swap last two lines ("ListView" and "TreeView") in the block of the function ResizeWnd (...) (childwnd.c.3):

      . . .
       if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBarWnd, 0, rt.left, rt.top, rt.right-rt.left - 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
       if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hAddressBtnWnd, 0, rt.right - 2*tHeight, rt.top, 2*tHeight, tHeight, SWP_NOZORDER|SWP_NOACTIVATE);
       if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx, rt.top + tHeight+2, rt.right-cx, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
       if (hdwp) hdwp = DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top + tHeight+2, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top-cy, SWP_NOZORDER|SWP_NOACTIVATE);
      . . .

      After this modification and rebuilding regedit.exe it works much better (figure regedit3.png).

      But it seems that problem is in BeginDeferWindowPos (...), DeferWindowPos (...) and EndDeferWindowPos (...). And there are many other applications that use them.

      Attachments

        1. childwnd.c.2
          30 kB
          R0bur
        2. childwnd.c.3
          30 kB
          R0bur
        3. regedit1.png
          39 kB
          R0bur
        4. regedit2.png
          60 kB
          R0bur
        5. regedit3.png
          39 kB
          R0bur

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              R0bur R0bur
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: