Ignore:
Timestamp:
Feb 10, 2003, 8:10:22 PM (23 years ago)
Author:
sandervl
Message:

EnumThreadWindows: must return windows in Z-order (experiments show EnumThreadWindows in NT4 behaves like this)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/win32wbase.cpp

    r9778 r9783  
    1 /* $Id: win32wbase.cpp,v 1.355 2003-02-07 15:34:48 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.356 2003-02-10 19:10:22 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    31603160//******************************************************************************
    31613161//Enumerate first-level children only and check thread id
     3162//NOTE: NT4 returns first-level children in Z-order!
    31623163//******************************************************************************
    31633164BOOL Win32BaseWindow::EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam)
    31643165{
    3165     Win32BaseWindow *child = 0;
     3166    Win32BaseWindow *wnd = NULL;
     3167    HWND henum, hwnd, hwndWin32;
    31663168    ULONG  tid, pid;
    31673169    BOOL   rc;
    3168     HWND   hwnd;
    3169 
    3170     dprintf(("EnumThreadWindows %x %x %x", dwThreadId, lpfn, lParam));
    3171 
    3172     for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild())
    3173     {
    3174         OSLibWinQueryWindowProcess(child->getOS2WindowHandle(), &pid, &tid);
    3175 
    3176         if(dwThreadId == tid) {
    3177             dprintf2(("EnumThreadWindows: Found Window %x", child->getWindowHandle()));
    3178             if((rc = lpfn(child->getWindowHandle(), lParam)) == FALSE) {
    3179                 break;
    3180             }
    3181         }
    3182     }
     3170
     3171    //Enumerate all top-level windows and check the process and thread ids
     3172    henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP);
     3173    hwnd = OSLibWinGetNextWindow(henum);
     3174
     3175    while(hwnd)
     3176    {
     3177        wnd = GetWindowFromOS2FrameHandle(hwnd);
     3178        if(wnd == NULL) {
     3179            hwnd = OSLibWinQueryClientWindow(hwnd);
     3180            if(hwnd)  wnd = GetWindowFromOS2Handle(hwnd);
     3181        }
     3182        if(wnd) {
     3183             hwndWin32 = wnd->getWindowHandle();
     3184        }
     3185        else hwndWin32 = 0;
     3186
     3187        if(wnd) RELEASE_WNDOBJ(wnd);
     3188
     3189        if(hwndWin32) {
     3190            OSLibWinQueryWindowProcess(hwnd, &pid, &tid);
     3191
     3192            if(dwThreadId == tid) {
     3193                dprintf(("EnumThreadWindows: Found Window %x", hwndWin32));
     3194                if((rc = lpfn(hwndWin32, lParam)) == FALSE) {
     3195                    break;
     3196                }
     3197            }
     3198        }
     3199        hwnd = OSLibWinGetNextWindow(henum);
     3200    }
     3201    OSLibWinEndEnumWindows(henum);
    31833202    return TRUE;
    31843203}
     
    37903809
    37913810        case GWL_HWNDPARENT:
     3811                dprintf(("GWL_ID GWL_HWNDPARENT %x, new %x", GetParent(), value));
    37923812                oldval = SetParent((HWND)value);
    37933813                break;
Note: See TracChangeset for help on using the changeset viewer.