Changeset 10316 for trunk/src/user32


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

Visible & Clip region changes

Location:
trunk/src/user32
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/USER32.DEF

    r10256 r10316  
    1 ; $Id: USER32.DEF,v 1.81 2003-10-02 10:35:59 sandervl Exp $
     1; $Id: USER32.DEF,v 1.82 2003-11-12 14:10:18 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    642642    SetWinEventHook            = _SetWinEventHook@28         @608
    643643
     644    GetAncestor                = _GetAncestor@8              @609
     645    GetWindowModuleFileNameA   = _GetWindowModuleFileNameA@12 @610
     646
    644647;------------
    645648; Windows 98
  • trunk/src/user32/dbgwrap.cpp

    r10190 r10316  
    698698DEBUGWRAP0(GetForegroundWindow)
    699699DEBUGWRAP4(GetLastActivePopup)
     700DEBUGWRAP12(GetWindowModuleFileNameA)
    700701DEBUGWRAP8(GetNextQueueWindow)
    701702DEBUGWRAP4(GetParent)
    702703DEBUGWRAP4(GetTopWindow)
    703704DEBUGWRAP8(GetWindow)
     705DEBUGWRAP8(GetAncestor)
    704706DEBUGWRAP4(GetWindowContextHelpId)
    705707DEBUGWRAP8(GetWindowRect)
     
    754756DEBUGWRAP4(GetDC)
    755757DEBUGWRAP12(GetDCEx)
    756 DEBUGWRAP12(FillRect)
    757 DEBUGWRAP12(FrameRect)
    758758DEBUGWRAP4(GetWindowDC)
    759759DEBUGWRAP8(ReleaseDC)
     
    764764DEBUGWRAP12(InvalidateRect)
    765765DEBUGWRAP12(InvalidateRgn)
    766 DEBUGWRAP8(InvertRect)
    767766DEBUGWRAP8(ValidateRect)
    768767DEBUGWRAP8(ValidateRgn)
  • trunk/src/user32/dc.cpp

    r10093 r10316  
    1 /* $Id: dc.cpp,v 1.121 2003-05-15 13:12:52 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.122 2003-11-12 14:10:18 sandervl Exp $ */
    22
    33/*
     
    594594   HDC   hdc;
    595595   HPS   hps;
    596    HRGN  hrgnUpdate, hrgnOld, hrgnClip, hrgnCombined;
     596   HRGN  hrgnUpdate;
    597597   RECTL rectl = { 1, 1, 2, 2 };
     598   pDCData pHps = NULLHANDLE;
    598599
    599600   hwnd = wnd->getOS2WindowHandle();
     
    602603   hrgnUpdate = GpiCreateRegion (hps, 1, &rectl);
    603604   WinQueryUpdateRegion (hwnd, hrgnUpdate);
    604    hrgnClip = GpiQueryClipRegion (hps);
    605 
    606    if (hrgnClip == NULLHANDLE)
    607    {
    608       GpiSetClipRegion (hps, hrgnUpdate, &hrgnOld);
    609    }
    610    else
    611    {
    612       hrgnCombined = GpiCreateRegion (hps, 1, &rectl);
    613       GpiCombineRegion (hps, hrgnCombined, hrgnClip, hrgnUpdate, CRGN_AND);
    614       GpiSetClipRegion (hps, hrgnCombined, &hrgnOld);
    615       GpiDestroyRegion (hps, hrgnUpdate);
    616       GpiDestroyRegion (hps, hrgnClip);
    617    }
    618    if (hrgnOld != NULLHANDLE)
    619       GpiDestroyRegion (hps, hrgnOld);
    620605
    621606   hdc = HPSToHDC (hwnd, hps, NULL, NULL);
     607
     608   pHps = (pDCData)GpiQueryDCData(hps);
     609   GdiSetVisRgn(pHps, hrgnUpdate);
    622610
    623611   erased = wnd->MsgEraseBackGround (hdc);
     
    676664        return (HDC)0;
    677665    }
    678 //    bIcon = (IsIconic(hwnd) && GetClassLongA(hWnd, GCL_HICON_W));
    679666    bIcon = IsIconic(hwnd);
    680667
     
    725712        }
    726713
    727         HRGN hrgnClip = GpiCreateRegion(pHps->hps, 1, &rectl);
    728         GpiSetClipRegion(pHps->hps, hrgnClip, &hrgnOldClip);
     714        //save old clip and visible regions (restored for CS_OWNDC windows in EndPaint)
     715        dprintf(("Old visible region %x; old clip region %x", pHps->hrgnWinVis, pHps->hrgnWin32Clip));
     716        wnd->SaveClipRegion(pHps->hrgnWin32Clip);
     717        wnd->SaveVisRegion(pHps->hrgnWinVis);
     718
     719        //clear visible and clip regions
     720        pHps->hrgnWin32Clip = NULLHANDLE;
     721        pHps->hrgnWinVis    = NULLHANDLE;
     722
     723        HRGN hrgnVis = GpiCreateRegion(pHps->hps, 1, &rectl);
     724        GdiSetVisRgn(pHps, hrgnVis);
    729725
    730726        selectClientArea(wnd, pHps);
    731727
    732         //save old clip region (restored for CS_OWNDC windows in EndPaint)
    733         wnd->SetClipRegion(hrgnOldClip);
    734728        if(bIcon) {
    735729              lComplexity = RGN_RECT;
     
    742736
    743737        //Query update region
    744         HRGN hrgnClip = GpiCreateRegion(pHps->hps, 1, &rectlClip);
    745         WinQueryUpdateRegion(hwndClient, hrgnClip);
    746         WinValidateRegion(hwndClient, hrgnClip, FALSE);
    747 
    748         dprintfRegion(pHps->hps, wnd->getWindowHandle(), hrgnClip);
     738        HRGN hrgnVis = GpiCreateRegion(pHps->hps, 1, &rectlClip);
     739        WinQueryUpdateRegion(hwndClient, hrgnVis);
     740        WinValidateRegion(hwndClient, hrgnVis, FALSE);
     741
     742        dprintfRegion(pHps->hps, wnd->getWindowHandle(), hrgnVis);
    749743
    750744#ifdef DEBUG
     
    754748#endif
    755749
     750        //save old clip and visible regions (restored for CS_OWNDC windows in EndPaint)
     751        dprintf(("Old visible region %x; old clip region %x", pHps->hrgnWinVis, pHps->hrgnWin32Clip));
     752        wnd->SaveClipRegion(pHps->hrgnWin32Clip);
     753        wnd->SaveVisRegion(pHps->hrgnWinVis);
     754
     755        //clear visible and clip regions
     756        pHps->hrgnWin32Clip = NULLHANDLE;
     757        pHps->hrgnWinVis    = NULLHANDLE;
     758
    756759        //set clip region
    757         lComplexity = GpiSetClipRegion(pHps->hps, hrgnClip, &hrgnOldClip);
    758 
    759         if(lComplexity == RGN_NULL) {
     760        lComplexity = GdiSetVisRgn(pHps, hrgnVis);
     761
     762        if(lComplexity == NULLREGION_W) {
    760763            dprintf (("BeginPaint %x: EMPTY update rectangle (vis=%d/%d show=%d/%d", hWnd,  WinIsWindowVisible(wnd->getOS2FrameWindowHandle()), WinIsWindowVisible(wnd->getOS2WindowHandle()),  WinIsWindowShowing(wnd->getOS2FrameWindowHandle()), WinIsWindowShowing(wnd->getOS2WindowHandle())));
    761764        }
     
    769772        dprintf(("ClipBox (%d): (%d,%d)(%d,%d)", lComplexity, rectlClip.xLeft, rectlClip.yBottom, rectlClip.xRight, rectlClip.yTop));
    770773#endif
    771         //save old clip region (restored for CS_OWNDC windows in EndPaint)
    772         wnd->SetClipRegion(hrgnOldClip);
    773774    }
    774775
     
    783784    WinShowTrackRect(wnd->getOS2WindowHandle(), FALSE);
    784785
    785     if((wnd->needsEraseBkgnd() || wnd->IsVisibleRegionChanged()) && lComplexity != RGN_NULL) {
    786         wnd->setEraseBkgnd(FALSE);
    787         wnd->SetVisibleRegionChanged(FALSE);
    788         lpps->fErase = (wnd->MsgEraseBackGround(pHps->hps) == 0);
     786    if((wnd->needsEraseBkgnd() || wnd->hasPMUpdateRegionChanged()) && lComplexity != RGN_NULL) {
     787         wnd->setEraseBkgnd(FALSE);
     788         wnd->SetPMUpdateRegionChanged(FALSE);
     789         lpps->fErase = (wnd->MsgEraseBackGround(pHps->hps) == 0);
    789790    }
    790791    else lpps->fErase = TRUE;
     
    817818{
    818819  HWND    hwnd = hWnd ? hWnd : HWND_DESKTOP;
    819   HRGN    hrgnOld;
    820820  pDCData pHps;
    821821
     
    832832    if (pHps && (pHps->hdcType == TYPE_3))
    833833    {
    834         GpiSetClipRegion(pHps->hps, wnd->GetClipRegion(), &hrgnOld);
    835         wnd->SetClipRegion(0);
    836         if(hrgnOld) {
    837             GpiDestroyRegion(pHps->hps, hrgnOld);
    838         }
     834        //restore previous visible and clip regions
     835        pHps->hrgnWin32Clip = NULLHANDLE;
     836        pHps->hrgnWinVis    = NULLHANDLE;
     837
     838        GdiSetVisRgn(pHps, wnd->GetVisRegion());
     839        GdiCombineVisRgnClipRgn(pHps, wnd->GetClipRegion(), RGN_AND_W);
     840
     841        wnd->SaveClipRegion(0);
     842        wnd->SaveVisRegion(0);
     843
    839844        pHps->hdcType = TYPE_1; //otherwise Open32's ReleaseDC fails
    840845        ReleaseDC(hwnd, pPaint->hdc);
     
    879884            if(pHps && pHps->psType == MICRO_CACHED) {
    880885                removeClientArea(wnd, pHps);
    881                 if(pHps->hrgnVis) {
    882                     GreDestroyRegion(pHps->hps, pHps->hrgnVis);
    883                     pHps->hrgnVis = 0;
     886                if(pHps->hrgnWinVis) {
     887                    GreDestroyRegion(pHps->hps, pHps->hrgnWinVis);
     888                    pHps->hrgnWinVis = 0;
     889                }
     890                if(pHps->hrgnWin32Clip) {
     891                    GreDestroyRegion(pHps->hps, pHps->hrgnWin32Clip);
     892                    pHps->hrgnWin32Clip = 0;
    884893                }
    885894            }
     
    912921}
    913922//******************************************************************************
    914 // This implementation of GetDCEx supports
     923// This implementation of GetDCEx supports:
     924//
    915925// DCX_WINDOW
    916926// DCX_CACHE
     
    922932// DCX_PARENTCLIP
    923933//
     934// Not supported:
     935//
     936// DCX_NORESETATTRS_W
     937// DCX_INTERSECTUPDATE_W
     938// DCX_LOCKWINDOWUPDATE_W
     939// DCX_VALIDATE_W
     940// DCX_EXCLUDEUPDATE_W
     941//
    924942//TODO: WM_SETREDRAW affects drawingAllowed flag!!
    925943//******************************************************************************
     
    935953   BOOL     creatingOwnDC = FALSE;
    936954   PS_Type  psType;
     955
     956    if(flags & (DCX_NORESETATTRS_W | DCX_INTERSECTUPDATE_W | DCX_LOCKWINDOWUPDATE_W | DCX_VALIDATE_W | DCX_EXCLUDEUPDATE_W)) {
     957        dprintf(("ERROR: GetDCEx: unsupported flags %x!!", flags));
     958        DebugInt3();
     959    }
    937960
    938961    if(hwnd == 0) {
     
    10661089        success = TRUE;
    10671090        if (flags & DCX_EXCLUDERGN_W)
    1068         {
    1069 #if 0 //CB: todo
    1070          long height;
    1071 
    1072          BytesNeeded = GetRegionData (hrgn, 0, NULL);
    1073          RgnData = (PRGNDATA_W)_alloca (BytesNeeded);
    1074          if (RgnData == NULL)
    1075                 goto error;
    1076          GetRegionData (hrgn, BytesNeeded, RgnData);
    1077 
    1078          i = RgnData->rdh.nCount;
    1079          pr = (PRECT)(RgnData->Buffer);
    1080 
    1081          if (flags & DCX_WINDOW_W)
    1082                 height = wnd->getWindowHeight();
    1083          else   height = wnd->getClientHeight();
    1084 
    1085          for (; (i > 0) && success; i--, pr++) {
    1086             LONG y = pr->yBottom;
    1087 
    1088             pr->yBottom = height - pr->yTop;
    1089             pr->yTop    = height - y;
    1090             success &= GpiExcludeClipRectangle (pHps->hps, pr);
    1091          }
    1092 #endif
     1091        {//exclude specified region from visible region
     1092            success = (GdiCombineVisRgn(pHps, hrgn, RGN_DIFF_W) != ERROR_W);
    10931093        }
    10941094        else //DCX_INTERSECTRGN_W
    1095         {
    1096             //SvL: I'm getting paint problems when clipping a dc created in GetDCEx
    1097             //     with a region that covers the entire window (RealPlayer 7 Update 1)
    1098             //     Using SelectClipRgn here doesn't make any difference.
    1099             if(ExtSelectClipRgn(pHps->hps, hrgn, RGN_AND_W) == ERROR_W) {
    1100                 dprintf(("ExtSelectClipRgn failed!!"));
    1101             }
     1095        {//intersect visible region with specified region
     1096            success = (GdiCombineVisRgn(pHps, hrgn, RGN_AND_W) != ERROR_W);
    11021097        }
    11031098        if (!success)
     
    12921287        //already (partly) invalidated
    12931288        if (!WinQueryUpdateRect (hwnd, NULL)) {
     1289            dprintf(("RDW_INVALIDATE: no update rectangle, disable %x WM_ERASEBKGND", wnd->getWindowHandle()));
    12941290            wnd->setEraseBkgnd(FALSE);
    12951291        }
     
    13321328    else if (redraw & RDW_VALIDATE_W)
    13331329    {
    1334         if (redraw & RDW_NOERASE_W)
     1330        if (redraw & RDW_NOERASE_W) {
     1331            dprintf(("RDW_NOERASE: disable %x WM_ERASEBKGND", wnd->getWindowHandle()));
    13351332            wnd->setEraseBkgnd(FALSE);
    1336 
     1333        }
    13371334        if (WinQueryUpdateRect (hwnd, NULL))
    13381335        {
  • trunk/src/user32/dc.h

    r5685 r10316  
    1 /* $Id: dc.h,v 1.17 2001-05-11 08:39:42 sandervl Exp $ */
     1/* $Id: dc.h,v 1.18 2003-11-12 14:10:19 sandervl Exp $ */
    22/*
    33 * public dc functions
     
    2222BOOL GetOS2UpdateRect(Win32BaseWindow *window,LPRECT pRect);
    2323
     24int WIN32API GetUpdateRgnFrame(HWND hwnd, HRGN hrgn);
     25
    2426#ifdef DEBUG
    2527void dprintfOrigin(HDC hdc);
     
    3032#ifdef INCLUDED_BY_DC
    3133/*********************/
    32 typedef struct
    33 {
    34     HDC   hdc;
    35     BOOL  fErase;
    36     RECT  rcPaint;
    37     BOOL  fRestore;
    38     BOOL  IncUpdate;
    39     BYTE  rgbReserved[32];
    40 } PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W;
    41 
    42 #define PS_SOLID_W         0x00000000
    43 #define PS_DASH_W          0x00000001
    44 #define PS_DOT_W           0x00000002
    45 #define PS_DASHDOT_W       0x00000003
    46 #define PS_DASHDOTDOT_W    0x00000004
    47 #define PS_NULL_W          0x00000005
    48 #define PS_INSIDEFRAME_W   0x00000006
    49 #define PS_USERSTYLE_W     0x00000007
    50 #define PS_ALTERNATE_W     0x00000008
    51 #define PS_STYLE_MASK_W    0x0000000f
    52 
    53 typedef struct
    54 {
    55     UINT   lopnStyle;
    56     POINT  lopnWidth;
    57     ULONG  lopnColor;
    58 } LOGPEN_W, *LPLOGPEN_W;
    59 
    60 typedef struct tagEXTLOGPEN
    61 {
    62     DWORD elpPenStyle;
    63     DWORD elpWidth;
    64     DWORD elpBrushStyle;
    65     DWORD elpColor;
    66     DWORD elpNumEntries;
    67     DWORD elpStyleEntry[1];
    68 } EXTLOGPEN_W, *PEXTLOGPEN_W, *NPEXTLOGPEN_W, *LPEXTLOGPEN_W;
    69 
    70 typedef struct
    71 {
    72     UINT   lbStyle;
    73     ULONG  lbColor;
    74     INT    lbHatch;
    75 } LOGBRUSH_W, *LPLOGBRUSH_W;
    7634
    7735typedef struct _penobject
     
    9048} tPenObject, *pPenObject;
    9149
    92 /* DC Graphics Mode */
    93 #define GM_COMPATIBLE_W     1
    94 #define GM_ADVANCED_W       2
    95 
    96 #define DCX_WINDOW_W                    0x00000001L
    97 #define DCX_CACHE_W                     0x00000002L
    98 #define DCX_NORESETATTRS_W              0x00000004L
    99 #define DCX_CLIPCHILDREN_W              0x00000008L
    100 #define DCX_CLIPSIBLINGS_W              0x00000010L
    101 #define DCX_PARENTCLIP_W                0x00000020L
    102 #define DCX_EXCLUDERGN_W                0x00000040L
    103 #define DCX_INTERSECTRGN_W              0x00000080L
    104 #define DCX_EXCLUDEUPDATE_W             0x00000100L
    105 #define DCX_INTERSECTUPDATE_W           0x00000200L
    106 #define DCX_LOCKWINDOWUPDATE_W          0x00000400L
    107 #define DCX_USESTYLE_W                  0x00010000L
    108 #define DCX_VALIDATE_W                  0x00200000L
    109 
    110 #define RDW_INVALIDATE_W       0x0001
    111 #define RDW_INTERNALPAINT_W    0x0002
    112 #define RDW_ERASE_W            0x0004
    113 #define RDW_VALIDATE_W         0x0008
    114 #define RDW_NOINTERNALPAINT_W  0x0010
    115 #define RDW_NOERASE_W          0x0020
    116 #define RDW_NOCHILDREN_W       0x0040
    117 #define RDW_ALLCHILDREN_W      0x0080
    118 #define RDW_UPDATENOW_W        0x0100
    119 #define RDW_ERASENOW_W         0x0200
    120 #define RDW_FRAME_W            0x0400
    121 #define RDW_NOFRAME_W          0x0800
    122 /* Xform FLAGS */
    123 #define MWT_IDENTITY_W        1
    124 #define MWT_LEFTMULTIPLY_W    2
    125 #define MWT_RIGHTMULTIPLY_W   3
    126 
    127 /* Mapping Modes */
    128 #define MM_TEXT_W             1
    129 #define MM_LOMETRIC_W         2
    130 #define MM_HIMETRIC_W         3
    131 #define MM_LOENGLISH_W        4
    132 #define MM_HIENGLISH_W        5
    133 #define MM_TWIPS_W            6
    134 #define MM_ISOTROPIC_W        7
    135 #define MM_ANISOTROPIC_W      8
    136 
    137 #define RGN_OR_W              2
    138 
    139 /* Window scrolling */
    140 #define SW_SCROLLCHILDREN_W    0x0001
    141 #define SW_INVALIDATE_W        0x0002
    142 #define SW_ERASE_W             0x0004
    143 #define SW_SMOOTHSCROLL_W      0x0010
    14450
    14551/*********************/
  • trunk/src/user32/dcrgn.cpp

    r9933 r10316  
    1 /* $Id: dcrgn.cpp,v 1.8 2003-03-22 20:27:11 sandervl Exp $ */
     1/* $Id: dcrgn.cpp,v 1.9 2003-11-12 14:10:19 sandervl Exp $ */
    22
    33/*
     
    4242#include "dbglocal.h"
    4343
     44#ifdef DEBUG
     45//#define dprintfRegion(a,b,c) if(DbgEnabledLvl2USER32[DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c)
     46//#define dprintfRegion(a,b,c) dprintfRegion1(a,b,c)
     47
     48static void dprintfRegion(HWND hWnd, HRGN hrgnClip)
     49{
     50 RGNRECT rgnRect = {0, 16, 0, RECTDIR_LFRT_TOPBOT};
     51 RECTL   rectRegion[16];
     52 APIRET  rc;
     53 HDC     hdc;
     54   
     55   hdc = GetDCEx(hWnd, NULL, DCX_CACHE_W|DCX_USESTYLE_W);
     56   dprintf(("dprintfRegion %x %x", hWnd, hdc));
     57   rc = GpiQueryRegionRects(hdc, hrgnClip, NULL, &rgnRect, &rectRegion[0]);
     58   for(int i=0;i<rgnRect.crcReturned;i++) {
     59        dprintf(("(%d,%d)(%d,%d)", rectRegion[i].xLeft, rectRegion[i].yBottom, rectRegion[i].xRight, rectRegion[i].yTop));
     60   }
     61   ReleaseDC(hWnd, hdc);
     62}
     63#else
     64#define dprintfRegion(b,c)
     65#endif
     66
    4467//******************************************************************************
    4568//******************************************************************************
     
    134157    if(lComplexity != RGN_NULL)
    135158    {
     159        dprintfRegion(hwnd, hrgn);
    136160        if(!setWinDeviceRegionFromPMDeviceRegion(hrgn, hrgn, NULL, wnd->getOS2WindowHandle()))
    137161        {
     
    142166        }
    143167        if(erase) sendEraseBkgnd(wnd);
     168    }
     169    RELEASE_WNDOBJ(wnd);
     170    return lComplexity;
     171}
     172//******************************************************************************
     173//TODO: Seems to return region in window coordinates instead of client coordinates
     174//******************************************************************************
     175int WIN32API GetUpdateRgnFrame(HWND hwnd, HRGN hrgn)
     176{
     177    LONG lComplexity;
     178    Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     179
     180    hrgn = ObjWinToOS2Region(hrgn);
     181    if(!wnd || !hrgn)
     182    {
     183        dprintf(("WARNING: GetUpdateRgnFrame %x %x invalid handle", hwnd, hrgn));
     184        SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     185        if(wnd) RELEASE_WNDOBJ(wnd);
     186        return ERROR_W;
     187    }
     188    lComplexity = WinQueryUpdateRegion(wnd->getOS2FrameWindowHandle(), hrgn);
     189    if(lComplexity == RGN_ERROR) {
     190        dprintf(("WARNING: GetUpdateRgnFrame %x %x RGN_ERROR", hwnd, hrgn));
     191        SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     192        RELEASE_WNDOBJ(wnd);
     193        return ERROR_W;
     194    }
     195
     196    if(lComplexity != RGN_NULL)
     197    {
     198        dprintfRegion(hwnd, hrgn);
     199        if(!setWinDeviceRegionFromPMDeviceRegion(hrgn, hrgn, NULL, wnd->getOS2FrameWindowHandle()))
     200        {
     201            dprintf(("WARNING: GetUpdateRgnFrame %x %x; setWinDeviceRegionFromPMDeviceRegion failed!", hwnd, hrgn));
     202            SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     203            RELEASE_WNDOBJ(wnd);
     204            return ERROR_W;
     205        }
    144206    }
    145207    RELEASE_WNDOBJ(wnd);
  • trunk/src/user32/inituser32.cpp

    r10284 r10316  
    1 /* $Id: inituser32.cpp,v 1.16 2003-10-22 12:43:13 sandervl Exp $ */
     1/* $Id: inituser32.cpp,v 1.17 2003-11-12 14:10:19 sandervl Exp $ */
    22/*
    33 * USER32 DLL entry point
     
    7171extern INT __cdecl wsnprintfA(LPSTR,UINT,LPCSTR,...);
    7272
    73 static char PMKBDHK_MODULE[16] = STD_PMKBDHK_MODULE;
    74 
    75 static BOOL pmkbdhk_installed = FALSE;
    76 static HMODULE hmodPMKBDHK;
    77 
    78 static PFN_HOOKINIT pfnHookInit = NULL;
    79 static PFN_HOOKTERM pfnHookTerm = NULL;
    80 
    81 // defined initialized in pmwindow.cpp: InitPM()
    82 extern HAB hab;
    83 
    84 //******************************************************************************
    85 //******************************************************************************
    86 void WIN32API SetCustomPMHookDll(LPSTR pszKbdDllName)
    87 {
    88    strcpy(PMKBDHK_MODULE, pszKbdDllName);
    89 }
    90 //******************************************************************************
    91 //******************************************************************************
    92 void pmkbdhk_initialize(HAB _hab)
    93 {
    94   APIRET rc;
    95 
    96   if ((pmkbdhk_installed == FALSE) && PMKBDHK_MODULE[0])
    97   {
    98     CHAR szBuf[260];
    99 
    100     // load the DLL
    101     rc = DosLoadModule(szBuf,
    102                        sizeof(szBuf),
    103                        PMKBDHK_MODULE,
    104                        &hmodPMKBDHK);
    105     if (NO_ERROR != rc)
    106     {
    107       dprintf(("USER32: pmkbdhk_initalize(%08xh) failed rc=%d\n",
    108                _hab,
    109                rc));
    110 
    111       return;
    112     }
    113 
    114     // get the entry points
    115     rc = DosQueryProcAddr(hmodPMKBDHK,
    116                           0,
    117                           PMKBDHK_HOOK_INIT,
    118                           (PFN*)&pfnHookInit);
    119     if (NO_ERROR == rc)
    120       rc = DosQueryProcAddr(hmodPMKBDHK,
    121                             0,
    122                             PMKBDHK_HOOK_TERM,
    123                             (PFN*)&pfnHookTerm);
    124 
    125     if (NO_ERROR != rc)
    126     {
    127       dprintf(("USER32: pmkbdhk_initalize(%08xh) failed importing functions, rc=%d\n",
    128                _hab,
    129                rc));
    130 
    131       // free the DLL again
    132       DosFreeModule(hmodPMKBDHK);
    133       hmodPMKBDHK = NULLHANDLE;
    134 
    135       return;
    136     }
    137 
    138     // now finally call the initializer function
    139     if(pfnHookInit(_hab, WIN32_STDCLASS) == FALSE) DebugInt3();
    140 
    141     // OK, hook is armed
    142     pmkbdhk_installed = TRUE;
    143   }
    144 }
    145 //******************************************************************************
    146 //******************************************************************************
    147 void pmkbdhk_terminate(void)
    148 {
    149   if (pmkbdhk_installed == TRUE)
    150   {
    151     // call the terminator function
    152     pfnHookTerm();
    153 
    154     // OK, hook is disarmed
    155     pmkbdhk_installed = FALSE;
    156   }
    157 
    158   // unload the dll
    159   if (NULLHANDLE != hmodPMKBDHK)
    160   {
    161     APIRET rc = DosFreeModule(hmodPMKBDHK);
    162     if (NO_ERROR != rc)
    163     {
    164       dprintf(("USER32: pmkbdhk_terminate() failed rc=%d\n",
    165                rc));
    166 
    167       hmodPMKBDHK = NULLHANDLE;
    168     }
    169   }
    170 }
    17173//******************************************************************************
    17274#define FONTSDIRECTORY "Fonts"
     
    261163           return 0UL;
    262164
    263          // try to install the keyboard hook
    264          pmkbdhk_initialize(hab);
    265 
    266165         InitializeWindowHandles();
    267166
     
    298197{
    299198  dprintf(("user32 exit\n"));
    300 
    301   // try to unistall the keyboard hook
    302   pmkbdhk_terminate();
    303199
    304200//SvL: Causes PM hangs on some (a lot?) machines. Reason unknown.
  • trunk/src/user32/pmwindow.cpp

    r10285 r10316  
    1 /* $Id: pmwindow.cpp,v 1.223 2003-10-22 12:43:51 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.224 2003-11-12 14:10:19 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    5959#include "menu.h"
    6060#include "user32api.h"
     61#include <kbdhook.h>
    6162
    6263#define DBG_LOCALLOG    DBG_pmwindow
    6364#include "dbglocal.h"
    6465
     66
    6567#define ODIN_SetExceptionHandler(a)
    6668#define ODIN_UnsetExceptionHandler(a)
    67 
    6869
    6970// Notification that focus change has completed (UNDOCUMENTED)
     
    8485BOOL    fDragDropDisabled = FALSE;
    8586
    86 const char WIN32_CDCLASS[]       = "Win32CDWindowClass";
    87       char WIN32_STDCLASS[255]   = "Win32WindowClass";
     87const char WIN32_CDCLASS[]       = ODIN_WIN32_CDCLASS;
     88      char WIN32_STDCLASS[255]   = ODIN_WIN32_STDCLASS;
    8889
    8990#define PMMENU_MINBUTTON           0
     
    190191    SetThreadMessageQueue(hmq);
    191192
     193    //initialize keyboard hook for first thread 
     194    hookInit(hab);
     195
    192196    BOOL rc = WinSetCp(hmq, GetDisplayCodepage());
    193197    dprintf(("InitPM: WinSetCP was %sOK", rc ? "" : "not "));
     
    255259    // query the font height to find out whether we have small or large fonts
    256260    DevQueryCaps(hdc, CAPS_GRAPHICS_CHAR_HEIGHT, 1, (PLONG)&CapsCharHeight);
     261    dprintf(("CAPS_GRAPHICS_CHAR_HEIGHT = %d", CapsCharHeight));
     262    if(CapsCharHeight > 16) {
     263       CapsCharHeight = 16;
     264    }
     265
     266#ifdef DEBUG
     267    ULONG temp;
     268    DevQueryCaps(hdc, CAPS_GRAPHICS_CHAR_WIDTH, 1, (PLONG)&temp);
     269    dprintf(("CAPS_GRAPHICS_CHAR_WIDTH = %d", temp));
     270    DevQueryCaps(hdc, CAPS_CHAR_HEIGHT, 1, (PLONG)&temp);
     271    dprintf(("CAPS_CHAR_HEIGTH = %d", temp));
     272    DevQueryCaps(hdc, CAPS_CHAR_WIDTH, 1, (PLONG)&temp);
     273    dprintf(("CAPS_CHAR_WIDTH = %d", temp));
     274    DevQueryCaps(hdc, CAPS_SMALL_CHAR_HEIGHT, 1, (PLONG)&temp);
     275    dprintf(("CAPS_SMALL_CHAR_HEIGTH = %d", temp));
     276    DevQueryCaps(hdc, CAPS_SMALL_CHAR_WIDTH, 1, (PLONG)&temp);
     277    dprintf(("CAPS_SMALL_CHAR_WIDTH = %d", temp));
     278    DevQueryCaps(hdc, CAPS_VERTICAL_FONT_RES, 1,(PLONG)&temp);
     279    dprintf(("CAPS_VERTICAL_FONT_RES = %d", temp));
     280    DevQueryCaps(hdc, CAPS_HORIZONTAL_FONT_RES, 1,(PLONG)&temp);
     281    dprintf(("CAPS_HORIZONTAL_FONT_RES = %d", temp));
     282#endif
    257283
    258284    DevCloseDC(hdc);
    259285
    260     dprintf(("InitPM: Desktop (%d,%d) bpp %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel));
     286    dprintf(("InitPM: Desktop (%d,%d) bpp %d font size %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel, CapsCharHeight));
    261287    return TRUE;
    262288} /* End of main */
     
    638664
    639665    case WM_SHOW:
     666    {
    640667        dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1));
    641668        win32wnd->MsgShow((ULONG)mp1);
    642         break;
     669 
     670        //if a child window is hidden, then the update region of the
     671        //parent changes and a WM_ERASEBKGND is required during the next
     672        //BeginPaint call.
     673        if((ULONG)mp1 == FALSE)
     674        {
     675            Win32BaseWindow *parent = win32wnd->getParent();
     676            if(parent) {
     677                dprintf(("PM Update region changed for parent %x", win32wnd->getWindowHandle()));
     678                parent->SetPMUpdateRegionChanged(TRUE);
     679            }
     680        }
     681        break;
     682    }
    643683
    644684    case WM_ACTIVATE:
     
    658698    {
    659699        dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp1)));
    660         win32wnd->SetVisibleRegionChanged(TRUE);
     700        win32wnd->SetPMUpdateRegionChanged(TRUE);
    661701        goto RunDefWndProc;
    662702    }
     
    12671307    case WM_PAINT:
    12681308    {
    1269       RECTL rectl;
     1309        RECTL rectl;
     1310        HRGN  hrgn;
     1311
     1312        hrgn = CreateRectRgn(0, 0, 0, 0);
     1313        GetUpdateRgnFrame(win32wnd->getWindowHandle(), hrgn);
    12701314
    12711315        HPS hps = WinBeginPaint(hwnd, NULL, &rectl);
     
    12851329
    12861330                mapOS2ToWin32Rect(win32wnd->getWindowHeight(), (PRECTLOS2)&rectl, &rectUpdate);
    1287                 win32wnd->MsgNCPaint(&rectUpdate);
     1331                win32wnd->MsgNCPaint(&rectUpdate, hrgn);
    12881332            }
    12891333        }
    12901334        WinEndPaint(hps);
     1335
     1336        DeleteObject(hrgn);
    12911337        break;
    12921338    }
     
    15991645        if ((pswp->fl & SWP_MAXIMIZE) && (win32wnd->getExStyle() & WS_EX_MDICHILD_W))
    16001646        {
    1601          SendMessageA(win32wnd->getWindowHandle(), WM_SYSCOMMAND_W, SC_MAXIMIZE_W, 0);
    1602          goto PosChangedEnd;
     1647            SendMessageA(win32wnd->getWindowHandle(), WM_SYSCOMMAND_W, SC_MAXIMIZE_W, 0);
     1648            goto PosChangedEnd;
    16031649        }
    16041650
     
    24782524//******************************************************************************
    24792525//******************************************************************************
     2526char *WIN32API QueryCustomStdClassName()
     2527{
     2528   return WIN32_STDCLASS;
     2529}
     2530//******************************************************************************
     2531//******************************************************************************
    24802532
    24812533#ifdef DEBUG
  • trunk/src/user32/user32.cpp

    r10275 r10316  
    1 /* $Id: user32.cpp,v 1.129 2003-10-20 17:17:23 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.130 2003-11-12 14:10:20 sandervl Exp $ */
    22
    33/*
     
    11441144/* Filled Shape Functions */
    11451145
    1146   /* Last COLOR id */
    1147 #define COLOR_MAX   COLOR_GRADIENTINACTIVECAPTION
    1148 
    1149 int WIN32API FillRect(HDC hDC, const RECT * lprc, HBRUSH hbr)
    1150 {
    1151     //SvL: brush 0 means current selected brush (verified in NT4)
    1152     if(hbr == 0) {
    1153         hbr = GetCurrentObject(hDC, OBJ_BRUSH);
    1154     }
    1155     else
    1156     if (hbr <= (HBRUSH) (COLOR_MAX + 1)) {
    1157         hbr = GetSysColorBrush( (INT) hbr - 1 );
    1158     }
    1159     dprintf(("USER32:  FillRect %x (%d,%d)(%d,%d) brush %X", hDC, lprc->left, lprc->top, lprc->right, lprc->bottom, hbr));
    1160     return O32_FillRect(hDC,lprc,hbr);
    1161 }
    1162 //******************************************************************************
    1163 //******************************************************************************
    1164 int WIN32API FrameRect( HDC hDC, const RECT * lprc, HBRUSH  hbr)
    1165 {
    1166     dprintf(("USER32: FrameRect %x (%d,%d)(%d,%d) brush %x", hDC, lprc->top, lprc->left, lprc->bottom, lprc->right, hbr));
    1167     return O32_FrameRect(hDC,lprc,hbr);
    1168 }
    1169 //******************************************************************************
    1170 //******************************************************************************
    1171 BOOL WIN32API InvertRect( HDC hDC, const RECT * lprc)
    1172 {
    1173     if(lprc) {
    1174          dprintf(("USER32: InvertRect %x (%d,%d)(%d,%d)", hDC, lprc->left, lprc->top, lprc->right, lprc->bottom));
    1175     }
    1176     else dprintf(("USER32: InvertRect %x NULL", hDC));
    1177     return O32_InvertRect(hDC,lprc);
    1178 }
     1146
    11791147
    11801148/* System Information Functions */
  • trunk/src/user32/user32api.h

    r9791 r10316  
    1 /* $Id: user32api.h,v 1.2 2003-02-13 10:12:25 sandervl Exp $ */
     1/* $Id: user32api.h,v 1.3 2003-11-12 14:10:20 sandervl Exp $ */
    22//Internal user32 functions
    33
    44#ifndef __USER32API_H_
    55#define __USER32API_H_
    6 
    7 HWND WINAPI GetAncestor( HWND hwnd, UINT type );
    86
    97//Notify that focus has changed (necessary for SetFocus(0) handling)
  • trunk/src/user32/user32dbg.def

    r10256 r10316  
    1 ; $Id: user32dbg.def,v 1.14 2003-10-02 10:36:00 sandervl Exp $
     1; $Id: user32dbg.def,v 1.15 2003-11-12 14:10:20 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    237237    ExcludeUpdateRgn           = _DbgExcludeUpdateRgn@8         @194
    238238    ExitWindowsEx              = _DbgExitWindowsEx@8            @195
    239     FillRect                   = _DbgFillRect@12                @196
     239    FillRect                   = _FillRect@12                   @196
    240240    FindWindowA                = _DbgFindWindowA@8              @197
    241241    FindWindowExA              = _DbgFindWindowExA@16           @198
     
    243243    FindWindowW                = _DbgFindWindowW@8              @200
    244244    FlashWindow                = _DbgFlashWindow@8              @201
    245     FrameRect                  = _DbgFrameRect@12               @202
     245    FrameRect                  = _FrameRect@12                  @202
    246246    FreeDDElParam              = _DbgFreeDDElParam@8            @203
    247247    GetActiveWindow            = _DbgGetActiveWindow@0          @204
     
    374374    InvalidateRect             = _DbgInvalidateRect@12          @328
    375375    InvalidateRgn              = _DbgInvalidateRgn@12           @329
    376     InvertRect                 = _DbgInvertRect@8               @330
     376    InvertRect                 = _InvertRect@8                  @330
    377377    IsCharAlphaA               = _IsCharAlphaA@4             @331
    378378    IsCharAlphaNumericA        = _IsCharAlphaNumericA@4      @332
     
    642642    SetWinEventHook            = _DbgSetWinEventHook@28         @608
    643643
     644    GetAncestor                = _DbgGetAncestor@8              @609
     645    GetWindowModuleFileNameA   = _DbgGetWindowModuleFileNameA@12 @610
     646
    644647;------------
    645648; Windows 98
  • trunk/src/user32/win32wbase.cpp

    r10275 r10316  
    1 /* $Id: win32wbase.cpp,v 1.379 2003-10-20 17:17:23 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.380 2003-11-12 14:10:20 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    117117  fComingToTop     = FALSE;
    118118  fMinMaxChange    = FALSE;
    119   fVisibleRegionChanged = FALSE;
     119  fPMUpdateRegionChanged = FALSE;
    120120  fEraseBkgndFlag  = TRUE;
    121121  fIsDragDropActive= FALSE;
     
    178178  hWindowRegion      = 0;
    179179  hClipRegion        = 0;
     180  hVisRegion         = 0;
    180181  hUpdateRegion      = 0;
    181182
     
    12191220    HDC   hdcErase = hdc;
    12201221
    1221     if (hdcErase == 0)
    1222         hdcErase = GetDC(getWindowHandle());
     1222    if (hdcErase == 0) {
     1223        DebugInt3();
     1224        return 0;
     1225    }
    12231226
    12241227    if(IsWindowIconic())
     
    12261229    else
    12271230        rc = SendMessageA(getWindowHandle(),WM_ERASEBKGND, hdcErase, 0);
    1228     if (hdc == 0)
    1229         ReleaseDC(getWindowHandle(), hdcErase);
     1231
    12301232    return (rc);
    12311233}
     
    12501252}
    12511253//******************************************************************************
    1252 //TODO: Should use update region, not rectangle
    1253 //******************************************************************************
    1254 ULONG Win32BaseWindow::MsgNCPaint(PRECT pUpdateRect)
    1255 {
    1256     HRGN hrgn;
     1254//******************************************************************************
     1255ULONG Win32BaseWindow::MsgNCPaint(PRECT pUpdateRect, HRGN hrgnUpdate)
     1256{
    12571257    ULONG rc;
    12581258    RECT client = rectClient;
     
    12671267    }
    12681268
    1269     dprintf(("MsgNCPaint (%d,%d)(%d,%d)", pUpdateRect->left, pUpdateRect->top, pUpdateRect->right, pUpdateRect->bottom));
    1270     hrgn = CreateRectRgnIndirect(pUpdateRect);
    1271 
    1272     rc = SendMessageA(getWindowHandle(),WM_NCPAINT, hrgn, 0);
     1269    rc = SendMessageA(getWindowHandle(),WM_NCPAINT, hrgnUpdate, 0);
    12731270    //Send WM_PAINTICON here if minimized, because client window will
    12741271    //not receive a (valid) WM_PAINT message
     
    12771274        rc = SendMessageA(getWindowHandle(),WM_PAINTICON, 1, 0);
    12781275    }
    1279 
    1280     DeleteObject(hrgn);
    12811276
    12821277    return rc;
     
    29192914}
    29202915//******************************************************************************
    2921 //Note: does not set last error if no parent (verified in NT4, SP6)
     2916// Win32BaseWindow::GetParent
     2917//
     2918// If the window is a child window, then return the parent window handle.
     2919// If it's a popup window, then return the owner
     2920//
     2921// Returns window handle of parent or owner window
     2922//
     2923// Note: does not set last error if no parent (verified in NT4, SP6)
    29222924//******************************************************************************
    29232925HWND Win32BaseWindow::GetParent()
  • trunk/src/user32/win32wbase.h

    r10190 r10316  
    1 /* $Id: win32wbase.h,v 1.155 2003-07-31 15:56:47 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.156 2003-11-12 14:10:21 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    136136         ULONG  MsgPaint(ULONG tmp1, BOOL select = TRUE);
    137137         ULONG  MsgEraseBackGround(HDC hdc);
    138          ULONG  MsgNCPaint(PRECT pUpdateRect);
     138         ULONG  MsgNCPaint(PRECT pUpdateRect, HRGN hrgnUpdate);
    139139         ULONG  MsgFormatFrame(WINDOWPOS *lpWndPos);
    140140         ULONG  DispatchMsgA(MSG *msg);
     
    231231         //Save old clip region for CS_OWNDC windows (in BeginPaint)
    232232         HRGN   GetClipRegion()                   { return hClipRegion; };
    233          void   SetClipRegion(HRGN hRegion)       { hClipRegion = hRegion; };
     233         HRGN   GetVisRegion()                    { return hVisRegion; };
     234         void   SaveClipRegion(HRGN hrgnClip)     { hClipRegion = hrgnClip; };
     235         void   SaveVisRegion(HRGN hrgnVis)       { hVisRegion = hrgnVis; };
    234236
    235237         void   saveAndValidateUpdateRegion();
     
    286288         BOOL   IsMixMaxStateChanging()       { return fMinMaxChange; };
    287289
    288          void   SetVisibleRegionChanged(BOOL changed) { fVisibleRegionChanged = changed; };
    289          BOOL   IsVisibleRegionChanged()              { return fVisibleRegionChanged; };
    290290         BOOL   setVisibleRgnNotifyProc(VISRGN_NOTIFY_PROC lpNotifyProc, DWORD dwUserData);
    291291         void   callVisibleRgnNotifyProc(BOOL fDrawingAllowed);
     
    415415                 fCXDefault:1,
    416416                 fParentDC:1,
    417              fComingToTop:1,
     417                 fComingToTop:1,
    418418                 isUnicode:1,
    419419                 fMinMaxChange:1,        //set when switching between min/max/restored state
    420                  fVisibleRegionChanged:1, //set when visible region has changed -> erase background must be sent during next BeginPaint
     420                 fPMUpdateRegionChanged:1, //set when PM update has changed -> erase background must be sent during next BeginPaint
    421421                 fEraseBkgndFlag:1,
    422422                 fIsDragDropActive:1,
     
    426426        ULONG   state;
    427427        HRGN    hWindowRegion;
    428         HRGN    hClipRegion;
     428        HRGN    hClipRegion, hVisRegion;
    429429        HRGN    hUpdateRegion;
    430430
     
    533533         VOID   setEraseBkgnd (BOOL erase)      { fEraseBkgndFlag = erase; }
    534534         BOOL   needsEraseBkgnd()               { return fEraseBkgndFlag; }
     535
     536         void   SetPMUpdateRegionChanged(BOOL changed)  { fPMUpdateRegionChanged = changed; };
     537         BOOL   hasPMUpdateRegionChanged()              { return fPMUpdateRegionChanged; };
    535538};
    536539
  • trunk/src/user32/win32wmisc.h

    r9598 r10316  
    1 /* $Id: win32wmisc.h,v 1.2 2003-01-03 16:35:58 sandervl Exp $ */
     1/* $Id: win32wmisc.h,v 1.3 2003-11-12 14:10:21 sandervl Exp $ */
    22/*
    33 * Misc. functions for window management
     
    3232INT  NC_HandleNCHitTest( HWND hwnd, POINT pt);
    3333
    34 HWND WINAPI GetAncestor( HWND hwnd, UINT type );
    35 
    3634#ifdef __cplusplus
    3735}
  • 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.