user32: SetWindowPos16 for Windows version less than 3.1

Matthias Schuchert matthias.schuchert at googlemail.com
Thu Sep 18 14:55:07 CDT 2008


In NE executables if the expected Windows version is less than 3.1 then
if the show or hide flag is set in SetWindowPos the window position and
size is not changed. This is somewhat documented in KB80897. Skat2095
(for Win3.0) relys on this to show dialogs.
---
 dlls/user32/wnd16.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c
index fd8ed60..4785413 100644
--- a/dlls/user32/wnd16.c
+++ b/dlls/user32/wnd16.c
@@ -1032,6 +1032,10 @@ HWND16 WINAPI GetNextWindow16( HWND16 hwnd, WORD flag )
 BOOL16 WINAPI SetWindowPos16( HWND16 hwnd, HWND16 hwndInsertAfter,
                             INT16 x, INT16 y, INT16 cx, INT16 cy, WORD flags)
 {
+    if( GetExpWinVer16( GetModuleHandle16( 0 )) < 0x30a) /* if linked
for < Win3.1 */
+        if (flags & (SWP_SHOWWINDOW|SWP_HIDEWINDOW)) /* and if show
or hide set */
+            flags |= SWP_NOSIZE|SWP_NOMOVE; /* then retain window position */
+
   return SetWindowPos( WIN_Handle32(hwnd),
full_insert_after_hwnd(hwndInsertAfter),
                        x, y, cx, cy, flags );
 }
--
1.5.4.3



More information about the wine-patches mailing list