Ignore:
Timestamp:
Nov 12, 2003, 3:13:26 PM (22 years ago)
Author:
sandervl
Message:

Visible & Clip region changes

File:
1 edited

Legend:

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

    r10145 r10316  
    1 /* $Id: window.cpp,v 1.136 2003-06-25 17:02:04 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.137 2003-11-12 14:10:21 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    4444#include <winuser32.h>
    4545#include "hook.h"
     46#include <wprocess.h>
    4647
    4748#define DBG_LOCALLOG    DBG_window
     
    711712{
    712713    HWND hwndAncestor = 0;
     714    Win32BaseWindow *window;
     715
     716    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     717    if(!window) {
     718        dprintf(("GetAncestor, window %x not found", hwnd));
     719        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     720        return FALSE;
     721    }
    713722
    714723    if (type == GA_PARENT)
     
    719728        }
    720729        //else no child -> no parent (GetParent returns owner otherwise!)
    721         return hwndAncestor;
    722     }
    723     dprintf(("Unsupported type %d", type));
    724     return 0;
     730    }
     731    else
     732    if (type == GA_ROOT)
     733    {
     734         hwndAncestor = window->GetTopParent();
     735    }
     736    else
     737    if (type == GA_ROOTOWNER)
     738    {
     739         if(hwnd != GetDesktopWindow())
     740         {
     741             hwndAncestor = hwnd;
     742             for(;;)
     743             {
     744                HWND parent = GetParent( hwndAncestor );
     745                if (!parent) break;
     746                hwndAncestor = parent;
     747             }
     748         }
     749    }
     750    else dprintf(("Unsupported type %d", type));
     751
     752    RELEASE_WNDOBJ(window);
     753    return hwndAncestor;
    725754}
    726755//******************************************************************************
     
    760789            return 0;
    761790        }
     791        fIgnoreKeystrokes = TRUE;
    762792        SendMessageA(lastFocus_W, WM_KILLFOCUS, 0, 0);
    763 
    764         fIgnoreKeystrokes = TRUE;
    765793
    766794        return lastFocus_W;
     
    21512179}
    21522180//******************************************************************************
     2181//The GetWindowModuleFileName function retrieves the full path and file name of
     2182//the module associated with the specified window handle.
     2183//******************************************************************************
     2184UINT WIN32API GetWindowModuleFileNameA(HWND hwnd, LPTSTR lpszFileName, UINT cchFileNameMax)
     2185{
     2186    WNDPROC lpfnWindowProc;
     2187
     2188    if (!IsWindow(hwnd)) {
     2189        dprintf(("warning: GetWindowModuleFileName: window %x not found!", hwnd));
     2190        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     2191        return 0;
     2192    }
     2193    lpfnWindowProc = (WNDPROC)GetWindowLongA(hwnd, GWL_WNDPROC);
     2194    return GetProcModuleFileNameA((ULONG)lpfnWindowProc, lpszFileName, cchFileNameMax);
     2195}
     2196//******************************************************************************
    21532197//******************************************************************************
    21542198
Note: See TracChangeset for help on using the changeset viewer.