Commit 0d92fe20 authored by Alexandre Julliard's avatar Alexandre Julliard

Make sure that returned window belongs to correct thread when checking

siblings of transparent windows in WIN_FindWinToRepaint.
parent 80f9d64f
...@@ -218,11 +218,11 @@ WND *WIN_LockWndPtr(WND *initWndPtr) ...@@ -218,11 +218,11 @@ WND *WIN_LockWndPtr(WND *initWndPtr)
USER_Lock(); USER_Lock();
/*and increment destruction monitoring*/ /*and increment destruction monitoring*/
initWndPtr->irefCount++; initWndPtr->irefCount++;
return initWndPtr; return initWndPtr;
} }
/*********************************************************************** /***********************************************************************
* WIN_ReleaseWndPtr * WIN_ReleaseWndPtr
* *
...@@ -257,7 +257,7 @@ void WIN_ReleaseWndPtr(WND *wndPtr) ...@@ -257,7 +257,7 @@ void WIN_ReleaseWndPtr(WND *wndPtr)
void WIN_UpdateWndPtr(WND **oldPtr, WND *newPtr) void WIN_UpdateWndPtr(WND **oldPtr, WND *newPtr)
{ {
WND *tmpWnd = NULL; WND *tmpWnd = NULL;
tmpWnd = WIN_LockWndPtr(newPtr); tmpWnd = WIN_LockWndPtr(newPtr);
WIN_ReleaseWndPtr(*oldPtr); WIN_ReleaseWndPtr(*oldPtr);
*oldPtr = tmpWnd; *oldPtr = tmpWnd;
...@@ -351,7 +351,7 @@ HWND WIN_FindWinToRepaint( HWND hwnd ) ...@@ -351,7 +351,7 @@ HWND WIN_FindWinToRepaint( HWND hwnd )
HWND hwndRet; HWND hwndRet;
WND *pWnd; WND *pWnd;
/* Note: the desktop window never gets WM_PAINT messages /* Note: the desktop window never gets WM_PAINT messages
* The real reason why is because Windows DesktopWndProc * The real reason why is because Windows DesktopWndProc
* does ValidateRgn inside WM_ERASEBKGND handler. * does ValidateRgn inside WM_ERASEBKGND handler.
*/ */
...@@ -361,42 +361,40 @@ HWND WIN_FindWinToRepaint( HWND hwnd ) ...@@ -361,42 +361,40 @@ HWND WIN_FindWinToRepaint( HWND hwnd )
for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next)) for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next))
{ {
if (!(pWnd->dwStyle & WS_VISIBLE)) if (!(pWnd->dwStyle & WS_VISIBLE)) continue;
{ if ((pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
TRACE("skipping window %04x\n", GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
pWnd->hwndSelf );
}
else if ((pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
break; break;
if (pWnd->child )
else if (pWnd->child ) {
if ((hwndRet = WIN_FindWinToRepaint( pWnd->child->hwndSelf )) ) if ((hwndRet = WIN_FindWinToRepaint( pWnd->child->hwndSelf )) )
{ {
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWnd);
return hwndRet; return hwndRet;
}
}
} }
}
if(!pWnd) if(!pWnd)
{ {
TRACE("nothing found\n");
return 0; return 0;
} }
hwndRet = pWnd->hwndSelf; hwndRet = pWnd->hwndSelf;
/* look among siblings if we got a transparent window */ /* look among siblings if we got a transparent window */
while (pWnd && ((pWnd->dwExStyle & WS_EX_TRANSPARENT) || while (pWnd)
!(pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT))))
{ {
if (!(pWnd->dwExStyle & WS_EX_TRANSPARENT) &&
(pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
{
hwndRet = pWnd->hwndSelf;
WIN_ReleaseWndPtr(pWnd);
break;
}
WIN_UpdateWndPtr(&pWnd,pWnd->next); WIN_UpdateWndPtr(&pWnd,pWnd->next);
} }
if (pWnd)
{
hwndRet = pWnd->hwndSelf;
WIN_ReleaseWndPtr(pWnd);
}
TRACE("found %04x\n",hwndRet); TRACE("found %04x\n",hwndRet);
return hwndRet; return hwndRet;
} }
...@@ -601,20 +599,20 @@ static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw) ...@@ -601,20 +599,20 @@ static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw)
if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16) if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16)
{ {
/* Never believe Microsoft's documentation... CreateWindowEx doc says /* Never believe Microsoft's documentation... CreateWindowEx doc says
* that if an overlapped window is created with WS_VISIBLE style bit * that if an overlapped window is created with WS_VISIBLE style bit
* set and the x parameter is set to CW_USEDEFAULT, the system ignores * set and the x parameter is set to CW_USEDEFAULT, the system ignores
* the y parameter. However, disassembling NT implementation (WIN32K.SYS) * the y parameter. However, disassembling NT implementation (WIN32K.SYS)
* reveals that * reveals that
* *
* 1) not only it checks for CW_USEDEFAULT but also for CW_USEDEFAULT16 * 1) not only it checks for CW_USEDEFAULT but also for CW_USEDEFAULT16
* 2) it does not ignore the y parameter as the docs claim; instead, it * 2) it does not ignore the y parameter as the docs claim; instead, it
* uses it as second parameter to ShowWindow() unless y is either * uses it as second parameter to ShowWindow() unless y is either
* CW_USEDEFAULT or CW_USEDEFAULT16. * CW_USEDEFAULT or CW_USEDEFAULT16.
* *
* The fact that we didn't do 2) caused bogus windows pop up when wine * The fact that we didn't do 2) caused bogus windows pop up when wine
* was running apps that were using this obscure feature. Example - * was running apps that were using this obscure feature. Example -
* calc.exe that comes with Win98 (only Win98, it's different from * calc.exe that comes with Win98 (only Win98, it's different from
* the one that comes with Win95 and NT) * the one that comes with Win95 and NT)
*/ */
if (cs->y != CW_USEDEFAULT && cs->y != CW_USEDEFAULT16) *sw = cs->y; if (cs->y != CW_USEDEFAULT && cs->y != CW_USEDEFAULT16) *sw = cs->y;
...@@ -649,7 +647,7 @@ static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw) ...@@ -649,7 +647,7 @@ static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw)
static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
WINDOWPROCTYPE type ) WINDOWPROCTYPE type )
{ {
INT sw = SW_SHOW; INT sw = SW_SHOW;
struct tagCLASS *classPtr; struct tagCLASS *classPtr;
WND *wndPtr; WND *wndPtr;
HWND hwnd, hwndLinkAfter; HWND hwnd, hwndLinkAfter;
...@@ -661,7 +659,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -661,7 +659,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
BOOL unicode = (type == WIN_PROC_32W); BOOL unicode = (type == WIN_PROC_32W);
TRACE("%s %s %08lx %08lx %d,%d %dx%d %04x %04x %08x %p\n", TRACE("%s %s %08lx %08lx %d,%d %dx%d %04x %04x %08x %p\n",
(type == WIN_PROC_32W) ? debugres_w((LPWSTR)cs->lpszName) : debugres_a(cs->lpszName), (type == WIN_PROC_32W) ? debugres_w((LPWSTR)cs->lpszName) : debugres_a(cs->lpszName),
(type == WIN_PROC_32W) ? debugres_w((LPWSTR)cs->lpszClass) : debugres_a(cs->lpszClass), (type == WIN_PROC_32W) ? debugres_w((LPWSTR)cs->lpszClass) : debugres_a(cs->lpszClass),
cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams ); cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams );
...@@ -699,7 +697,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -699,7 +697,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
* These are patches that appear to affect both the style loaded into the * These are patches that appear to affect both the style loaded into the
* WIN structure and passed in the CreateStruct to the WM_CREATE etc. * WIN structure and passed in the CreateStruct to the WM_CREATE etc.
* *
* WS_EX_WINDOWEDGE appears to be enforced based on the other styles, so * WS_EX_WINDOWEDGE appears to be enforced based on the other styles, so
* why does the user get to set it? * why does the user get to set it?
*/ */
...@@ -743,7 +741,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -743,7 +741,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
else else
wndPtr->owner = GetAncestor( cs->hwndParent, GA_ROOT ); wndPtr->owner = GetAncestor( cs->hwndParent, GA_ROOT );
} }
wndPtr->class = classPtr; wndPtr->class = classPtr;
wndPtr->winproc = winproc; wndPtr->winproc = winproc;
...@@ -907,7 +905,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -907,7 +905,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
HWND16 WINAPI CreateWindow16( LPCSTR className, LPCSTR windowName, HWND16 WINAPI CreateWindow16( LPCSTR className, LPCSTR windowName,
DWORD style, INT16 x, INT16 y, INT16 width, DWORD style, INT16 x, INT16 y, INT16 width,
INT16 height, HWND16 parent, HMENU16 menu, INT16 height, HWND16 parent, HMENU16 menu,
HINSTANCE16 instance, LPVOID data ) HINSTANCE16 instance, LPVOID data )
{ {
return CreateWindowEx16( 0, className, windowName, style, return CreateWindowEx16( 0, className, windowName, style,
x, y, width, height, parent, menu, instance, data ); x, y, width, height, parent, menu, instance, data );
...@@ -921,7 +919,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, ...@@ -921,7 +919,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className,
LPCSTR windowName, DWORD style, INT16 x, LPCSTR windowName, DWORD style, INT16 x,
INT16 y, INT16 width, INT16 height, INT16 y, INT16 width, INT16 height,
HWND16 parent, HMENU16 menu, HWND16 parent, HMENU16 menu,
HINSTANCE16 instance, LPVOID data ) HINSTANCE16 instance, LPVOID data )
{ {
ATOM classAtom; ATOM classAtom;
CREATESTRUCTA cs; CREATESTRUCTA cs;
...@@ -1276,7 +1274,7 @@ BOOL16 WINAPI CloseWindow16( HWND16 hwnd ) ...@@ -1276,7 +1274,7 @@ BOOL16 WINAPI CloseWindow16( HWND16 hwnd )
return CloseWindow( hwnd ); return CloseWindow( hwnd );
} }
/*********************************************************************** /***********************************************************************
* CloseWindow (USER32.@) * CloseWindow (USER32.@)
*/ */
...@@ -1284,7 +1282,7 @@ BOOL WINAPI CloseWindow( HWND hwnd ) ...@@ -1284,7 +1282,7 @@ BOOL WINAPI CloseWindow( HWND hwnd )
{ {
WND * wndPtr = WIN_FindWndPtr( hwnd ); WND * wndPtr = WIN_FindWndPtr( hwnd );
BOOL retvalue; BOOL retvalue;
if (!wndPtr || (wndPtr->dwStyle & WS_CHILD)) if (!wndPtr || (wndPtr->dwStyle & WS_CHILD))
{ {
retvalue = FALSE; retvalue = FALSE;
...@@ -1298,7 +1296,7 @@ end: ...@@ -1298,7 +1296,7 @@ end:
} }
/*********************************************************************** /***********************************************************************
* OpenIcon (USER.44) * OpenIcon (USER.44)
*/ */
...@@ -1416,7 +1414,7 @@ HWND WINAPI FindWindowExA( HWND parent, HWND child, ...@@ -1416,7 +1414,7 @@ HWND WINAPI FindWindowExA( HWND parent, HWND child,
{ {
/* If the atom doesn't exist, then no class */ /* If the atom doesn't exist, then no class */
/* with this name exists either. */ /* with this name exists either. */
if (!(atom = GlobalFindAtomA( className ))) if (!(atom = GlobalFindAtomA( className )))
{ {
SetLastError (ERROR_CANNOT_FIND_WND_CLASS); SetLastError (ERROR_CANNOT_FIND_WND_CLASS);
return 0; return 0;
...@@ -1546,7 +1544,7 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable ) ...@@ -1546,7 +1544,7 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
/*********************************************************************** /***********************************************************************
* IsWindowEnabled (USER.35) * IsWindowEnabled (USER.35)
*/ */
BOOL16 WINAPI IsWindowEnabled16(HWND16 hWnd) BOOL16 WINAPI IsWindowEnabled16(HWND16 hWnd)
{ {
return IsWindowEnabled(hWnd); return IsWindowEnabled(hWnd);
...@@ -1555,10 +1553,10 @@ BOOL16 WINAPI IsWindowEnabled16(HWND16 hWnd) ...@@ -1555,10 +1553,10 @@ BOOL16 WINAPI IsWindowEnabled16(HWND16 hWnd)
/*********************************************************************** /***********************************************************************
* IsWindowEnabled (USER32.@) * IsWindowEnabled (USER32.@)
*/ */
BOOL WINAPI IsWindowEnabled(HWND hWnd) BOOL WINAPI IsWindowEnabled(HWND hWnd)
{ {
WND * wndPtr; WND * wndPtr;
BOOL retvalue; BOOL retvalue;
if (!(wndPtr = WIN_FindWndPtr(hWnd))) return FALSE; if (!(wndPtr = WIN_FindWndPtr(hWnd))) return FALSE;
...@@ -1574,7 +1572,7 @@ BOOL WINAPI IsWindowEnabled(HWND hWnd) ...@@ -1574,7 +1572,7 @@ BOOL WINAPI IsWindowEnabled(HWND hWnd)
*/ */
BOOL WINAPI IsWindowUnicode( HWND hwnd ) BOOL WINAPI IsWindowUnicode( HWND hwnd )
{ {
WND * wndPtr; WND * wndPtr;
BOOL retvalue; BOOL retvalue;
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return FALSE; if (!(wndPtr = WIN_FindWndPtr(hwnd))) return FALSE;
...@@ -1614,16 +1612,16 @@ WORD WINAPI GetWindowWord( HWND hwnd, INT offset ) ...@@ -1614,16 +1612,16 @@ WORD WINAPI GetWindowWord( HWND hwnd, INT offset )
} }
switch(offset) switch(offset)
{ {
case GWW_ID: case GWW_ID:
if (HIWORD(wndPtr->wIDmenu)) if (HIWORD(wndPtr->wIDmenu))
WARN("GWW_ID: discards high bits of 0x%08x!\n", WARN("GWW_ID: discards high bits of 0x%08x!\n",
wndPtr->wIDmenu); wndPtr->wIDmenu);
retvalue = (WORD)wndPtr->wIDmenu; retvalue = (WORD)wndPtr->wIDmenu;
goto end; goto end;
case GWW_HWNDPARENT: case GWW_HWNDPARENT:
retvalue = GetParent(hwnd); retvalue = GetParent(hwnd);
goto end; goto end;
case GWW_HINSTANCE: case GWW_HINSTANCE:
if (HIWORD(wndPtr->hInstance)) if (HIWORD(wndPtr->hInstance))
WARN("GWW_HINSTANCE: discards high bits of 0x%08x!\n", WARN("GWW_HINSTANCE: discards high bits of 0x%08x!\n",
wndPtr->hInstance); wndPtr->hInstance);
...@@ -1756,7 +1754,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval, ...@@ -1756,7 +1754,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
LONG *ptr, retval; LONG *ptr, retval;
WND * wndPtr = WIN_FindWndPtr( hwnd ); WND * wndPtr = WIN_FindWndPtr( hwnd );
STYLESTRUCT style; STYLESTRUCT style;
TRACE("%x=%p %x %lx %x\n",hwnd, wndPtr, offset, newval, type); TRACE("%x=%p %x %lx %x\n",hwnd, wndPtr, offset, newval, type);
if (!wndPtr) if (!wndPtr)
...@@ -1783,7 +1781,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval, ...@@ -1783,7 +1781,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
if ((offset == DWL_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) if ((offset == DWL_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG))
{ {
retval = (LONG)WINPROC_GetProc( (HWINDOWPROC)*ptr, type ); retval = (LONG)WINPROC_GetProc( (HWINDOWPROC)*ptr, type );
WINPROC_SetProc( (HWINDOWPROC *)ptr, (WNDPROC16)newval, WINPROC_SetProc( (HWINDOWPROC *)ptr, (WNDPROC16)newval,
type, WIN_PROC_WINDOW ); type, WIN_PROC_WINDOW );
goto end; goto end;
} }
...@@ -1798,7 +1796,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval, ...@@ -1798,7 +1796,7 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
goto end; goto end;
case GWL_WNDPROC: case GWL_WNDPROC:
retval = (LONG)WINPROC_GetProc( wndPtr->winproc, type ); retval = (LONG)WINPROC_GetProc( wndPtr->winproc, type );
WINPROC_SetProc( &wndPtr->winproc, (WNDPROC16)newval, WINPROC_SetProc( &wndPtr->winproc, (WNDPROC16)newval,
type, WIN_PROC_WINDOW ); type, WIN_PROC_WINDOW );
goto end; goto end;
case GWL_STYLE: case GWL_STYLE:
...@@ -1809,11 +1807,11 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval, ...@@ -1809,11 +1807,11 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
SendMessageA(hwnd,WM_STYLECHANGED,GWL_STYLE,(LPARAM)&style); SendMessageA(hwnd,WM_STYLECHANGED,GWL_STYLE,(LPARAM)&style);
retval = style.styleOld; retval = style.styleOld;
goto end; goto end;
case GWL_USERDATA: case GWL_USERDATA:
ptr = &wndPtr->userdata; ptr = &wndPtr->userdata;
break; break;
case GWL_EXSTYLE: case GWL_EXSTYLE:
style.styleOld = wndPtr->dwExStyle; style.styleOld = wndPtr->dwExStyle;
style.styleNew = newval; style.styleNew = newval;
SendMessageA(hwnd,WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&style); SendMessageA(hwnd,WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&style);
...@@ -1888,7 +1886,7 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval ) ...@@ -1888,7 +1886,7 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval )
* SetWindowLongW (USER32.@) Set window attribute * SetWindowLongW (USER32.@) Set window attribute
* *
* SetWindowLong() alters one of a window's attributes or sets a 32-bit (long) * SetWindowLong() alters one of a window's attributes or sets a 32-bit (long)
* value in a window's extra memory. * value in a window's extra memory.
* *
* The _hwnd_ parameter specifies the window. is the handle to a * The _hwnd_ parameter specifies the window. is the handle to a
* window that has extra memory. The _newval_ parameter contains the * window that has extra memory. The _newval_ parameter contains the
...@@ -1899,22 +1897,22 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval ) ...@@ -1899,22 +1897,22 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval )
* *
* GWL_EXSTYLE The window's extended window style * GWL_EXSTYLE The window's extended window style
* *
* GWL_STYLE The window's window style. * GWL_STYLE The window's window style.
* *
* GWL_WNDPROC Pointer to the window's window procedure. * GWL_WNDPROC Pointer to the window's window procedure.
* *
* GWL_HINSTANCE The window's pplication instance handle. * GWL_HINSTANCE The window's pplication instance handle.
* *
* GWL_ID The window's identifier. * GWL_ID The window's identifier.
* *
* GWL_USERDATA The window's user-specified data. * GWL_USERDATA The window's user-specified data.
* *
* If the window is a dialog box, the _offset_ parameter can be one of * If the window is a dialog box, the _offset_ parameter can be one of
* the following values: * the following values:
* *
* DWL_DLGPROC The address of the window's dialog box procedure. * DWL_DLGPROC The address of the window's dialog box procedure.
* *
* DWL_MSGRESULT The return value of a message * DWL_MSGRESULT The return value of a message
* that the dialog box procedure processed. * that the dialog box procedure processed.
* *
* DWL_USER Application specific information. * DWL_USER Application specific information.
...@@ -1926,10 +1924,10 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval ) ...@@ -1926,10 +1924,10 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval )
* *
* NOTES * NOTES
* *
* Extra memory for a window class is specified by a nonzero cbWndExtra * Extra memory for a window class is specified by a nonzero cbWndExtra
* parameter of the WNDCLASS structure passed to RegisterClass() at the * parameter of the WNDCLASS structure passed to RegisterClass() at the
* time of class creation. * time of class creation.
* *
* Using GWL_WNDPROC to set a new window procedure effectively creates * Using GWL_WNDPROC to set a new window procedure effectively creates
* a window subclass. Use CallWindowProc() in the new windows procedure * a window subclass. Use CallWindowProc() in the new windows procedure
* to pass messages to the superclass's window procedure. * to pass messages to the superclass's window procedure.
...@@ -1956,10 +1954,10 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval ) ...@@ -1956,10 +1954,10 @@ LONG WINAPI SetWindowLongA( HWND hwnd, INT offset, LONG newval )
* *
* CONFORMANCE * CONFORMANCE
* *
* ECMA-234, Win32 * ECMA-234, Win32
* *
*/ */
LONG WINAPI SetWindowLongW( LONG WINAPI SetWindowLongW(
HWND hwnd, /* [in] window to alter */ HWND hwnd, /* [in] window to alter */
INT offset, /* [in] offset, in bytes, of location to alter */ INT offset, /* [in] offset, in bytes, of location to alter */
LONG newval /* [in] new value of location */ LONG newval /* [in] new value of location */
...@@ -2262,7 +2260,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent ) ...@@ -2262,7 +2260,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
/* SetParent additionally needs to make hwnd the topmost window /* SetParent additionally needs to make hwnd the topmost window
in the x-order and send the expected WM_WINDOWPOSCHANGING and in the x-order and send the expected WM_WINDOWPOSCHANGING and
WM_WINDOWPOSCHANGED notification messages. WM_WINDOWPOSCHANGED notification messages.
*/ */
SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE| SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|
...@@ -2388,7 +2386,7 @@ HWND16 WINAPI GetWindow16( HWND16 hwnd, WORD rel ) ...@@ -2388,7 +2386,7 @@ HWND16 WINAPI GetWindow16( HWND16 hwnd, WORD rel )
HWND WINAPI GetWindow( HWND hwnd, WORD rel ) HWND WINAPI GetWindow( HWND hwnd, WORD rel )
{ {
HWND retval; HWND retval;
WND * wndPtr = WIN_FindWndPtr( hwnd ); WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0; if (!wndPtr) return 0;
switch(rel) switch(rel)
...@@ -2396,7 +2394,7 @@ HWND WINAPI GetWindow( HWND hwnd, WORD rel ) ...@@ -2396,7 +2394,7 @@ HWND WINAPI GetWindow( HWND hwnd, WORD rel )
case GW_HWNDFIRST: case GW_HWNDFIRST:
retval = wndPtr->parent ? wndPtr->parent->child->hwndSelf : 0; retval = wndPtr->parent ? wndPtr->parent->child->hwndSelf : 0;
goto end; goto end;
case GW_HWNDLAST: case GW_HWNDLAST:
if (!wndPtr->parent) if (!wndPtr->parent)
{ {
...@@ -2409,11 +2407,11 @@ HWND WINAPI GetWindow( HWND hwnd, WORD rel ) ...@@ -2409,11 +2407,11 @@ HWND WINAPI GetWindow( HWND hwnd, WORD rel )
} }
retval = wndPtr->hwndSelf; retval = wndPtr->hwndSelf;
goto end; goto end;
case GW_HWNDNEXT: case GW_HWNDNEXT:
retval = wndPtr->next ? wndPtr->next->hwndSelf : 0; retval = wndPtr->next ? wndPtr->next->hwndSelf : 0;
goto end; goto end;
case GW_HWNDPREV: case GW_HWNDPREV:
if (!wndPtr->parent) if (!wndPtr->parent)
{ {
...@@ -2437,7 +2435,7 @@ HWND WINAPI GetWindow( HWND hwnd, WORD rel ) ...@@ -2437,7 +2435,7 @@ HWND WINAPI GetWindow( HWND hwnd, WORD rel )
} }
retval = 0; retval = 0;
goto end; goto end;
case GW_OWNER: case GW_OWNER:
retval = wndPtr->owner; retval = wndPtr->owner;
goto end; goto end;
...@@ -2463,13 +2461,13 @@ HWND16 WINAPI GetNextWindow16( HWND16 hwnd, WORD flag ) ...@@ -2463,13 +2461,13 @@ HWND16 WINAPI GetNextWindow16( HWND16 hwnd, WORD flag )
} }
/*********************************************************************** /***********************************************************************
* WIN_InternalShowOwnedPopups * WIN_InternalShowOwnedPopups
* *
* Internal version of ShowOwnedPopups; Wine functions should use this * Internal version of ShowOwnedPopups; Wine functions should use this
* to avoid interfering with application calls to ShowOwnedPopups * to avoid interfering with application calls to ShowOwnedPopups
* and to make sure the application can't prevent showing/hiding. * and to make sure the application can't prevent showing/hiding.
* *
* Set unmanagedOnly to TRUE to show/hide unmanaged windows only. * Set unmanagedOnly to TRUE to show/hide unmanaged windows only.
* *
*/ */
...@@ -2867,10 +2865,10 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert ) ...@@ -2867,10 +2865,10 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
if (bInvert && !(wndPtr->flags & WIN_NCACTIVATED)) if (bInvert && !(wndPtr->flags & WIN_NCACTIVATED))
{ {
HDC hDC = GetDC(hWnd); HDC hDC = GetDC(hWnd);
if (!SendMessageW( hWnd, WM_ERASEBKGND, (WPARAM16)hDC, 0 )) if (!SendMessageW( hWnd, WM_ERASEBKGND, (WPARAM16)hDC, 0 ))
wndPtr->flags |= WIN_NEEDS_ERASEBKGND; wndPtr->flags |= WIN_NEEDS_ERASEBKGND;
ReleaseDC( hWnd, hDC ); ReleaseDC( hWnd, hDC );
wndPtr->flags |= WIN_NCACTIVATED; wndPtr->flags |= WIN_NCACTIVATED;
} }
...@@ -2946,7 +2944,7 @@ BOOL WINAPI SetWindowContextHelpId( HWND hwnd, DWORD id ) ...@@ -2946,7 +2944,7 @@ BOOL WINAPI SetWindowContextHelpId( HWND hwnd, DWORD id )
/******************************************************************* /*******************************************************************
* DRAG_QueryUpdate * DRAG_QueryUpdate
* *
* recursively find a child that contains spDragInfo->pt point * recursively find a child that contains spDragInfo->pt point
* and send WM_QUERYDROPOBJECT * and send WM_QUERYDROPOBJECT
*/ */
BOOL16 DRAG_QueryUpdate( HWND hQueryWnd, SEGPTR spDragInfo, BOOL bNoSend ) BOOL16 DRAG_QueryUpdate( HWND hQueryWnd, SEGPTR spDragInfo, BOOL bNoSend )
...@@ -3108,7 +3106,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3108,7 +3106,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
lpDragInfo->wFlags = wObj; lpDragInfo->wFlags = wObj;
lpDragInfo->hList = szList; /* near pointer! */ lpDragInfo->hList = szList; /* near pointer! */
lpDragInfo->hOfStruct = hOfStruct; lpDragInfo->hOfStruct = hOfStruct;
lpDragInfo->l = 0L; lpDragInfo->l = 0L;
SetCapture(hWnd); SetCapture(hWnd);
ShowCursor( TRUE ); ShowCursor( TRUE );
...@@ -3136,18 +3134,18 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3136,18 +3134,18 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
SetCursor(hCurrentCursor); SetCursor(hCurrentCursor);
/* send WM_DRAGLOOP */ /* send WM_DRAGLOOP */
SendMessage16( hWnd, WM_DRAGLOOP, (WPARAM16)(hCurrentCursor != hBummer), SendMessage16( hWnd, WM_DRAGLOOP, (WPARAM16)(hCurrentCursor != hBummer),
(LPARAM) spDragInfo ); (LPARAM) spDragInfo );
/* send WM_DRAGSELECT or WM_DRAGMOVE */ /* send WM_DRAGSELECT or WM_DRAGMOVE */
if( hCurrentWnd != lpDragInfo->hScope ) if( hCurrentWnd != lpDragInfo->hScope )
{ {
if( hCurrentWnd ) if( hCurrentWnd )
SendMessage16( hCurrentWnd, WM_DRAGSELECT, 0, SendMessage16( hCurrentWnd, WM_DRAGSELECT, 0,
(LPARAM)MAKELONG(LOWORD(spDragInfo)+sizeof(DRAGINFO16), (LPARAM)MAKELONG(LOWORD(spDragInfo)+sizeof(DRAGINFO16),
HIWORD(spDragInfo)) ); HIWORD(spDragInfo)) );
hCurrentWnd = lpDragInfo->hScope; hCurrentWnd = lpDragInfo->hScope;
if( hCurrentWnd ) if( hCurrentWnd )
SendMessage16( hCurrentWnd, WM_DRAGSELECT, 1, (LPARAM)spDragInfo); SendMessage16( hCurrentWnd, WM_DRAGSELECT, 1, (LPARAM)spDragInfo);
} }
else else
if( hCurrentWnd ) if( hCurrentWnd )
...@@ -3164,8 +3162,8 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, ...@@ -3164,8 +3162,8 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
if (hDragCursor) DestroyCursor( hDragCursor ); if (hDragCursor) DestroyCursor( hDragCursor );
} }
if( hCurrentCursor != hBummer ) if( hCurrentCursor != hBummer )
msg.lParam = SendMessage16( lpDragInfo->hScope, WM_DROPOBJECT, msg.lParam = SendMessage16( lpDragInfo->hScope, WM_DROPOBJECT,
(WPARAM16)hWnd, (LPARAM)spDragInfo ); (WPARAM16)hWnd, (LPARAM)spDragInfo );
else else
msg.lParam = 0; msg.lParam = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment