user32: search more aggressively for a window under a tooltip

Daniel Jelinski djelinski1 at gmail.com
Fri Jul 20 18:20:54 CDT 2012


Fixes bug 9512 and bug 8914, tested with Delphi and DVD Profiler.
Still not perfect - according to MSDN the function should never return
a window belonging to another thread.
-------------- next part --------------
From 088b5ff5b5726cb4f2a74215d4490ec84a9f199c Mon Sep 17 00:00:00 2001
From: Daniel Jelinski <djelinski1 at gmail.com>
Date: Sat, 21 Jul 2012 00:54:46 +0200
Subject: user32: search more aggressively for a window under a tooltip

---
 dlls/user32/winpos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index c4b61a8..b3f108b 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -308,7 +308,7 @@ HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest )
 {
     int i, res;
     HWND ret, *list;
-
+    HWND oriScope = hwndScope;
     if (!hwndScope) hwndScope = GetDesktopWindow();
 
     *hittest = HTNOWHERE;
@@ -348,6 +348,7 @@ HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest )
     }
     ret = list[i];
     HeapFree( GetProcessHeap(), 0, list );
+    if(!ret && oriScope) return WINPOS_WindowFromPoint(NULL, pt, hittest );
     TRACE( "scope %p (%d,%d) returning %p\n", hwndScope, pt.x, pt.y, ret );
     return ret;
 }
-- 
1.7.5.4


More information about the wine-patches mailing list