Commit 26ab7010 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move WM_SHOWWINDOW implementation from user32.

parent 04716457
...@@ -73,57 +73,6 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) ...@@ -73,57 +73,6 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType )
} }
/***********************************************************************
* DEFWND_DefWinProc
*
* Default window procedure for messages that are the same in Ansi and Unicode.
*/
static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch(msg)
{
case WM_NCMOUSEMOVE:
return NC_HandleNCMouseMove( hwnd, wParam, lParam );
case WM_NCMOUSELEAVE:
return NC_HandleNCMouseLeave( hwnd );
case WM_SYSCOMMAND:
return NC_HandleSysCommand( hwnd, wParam, lParam );
case WM_SHOWWINDOW:
{
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
WND *pWnd;
if (!lParam) return 0; /* sent from ShowWindow */
if ((style & WS_VISIBLE) && wParam) return 0;
if (!(style & WS_VISIBLE) && !wParam) return 0;
if (!GetWindow( hwnd, GW_OWNER )) return 0;
if (!(pWnd = WIN_GetPtr( hwnd ))) return 0;
if (pWnd == WND_OTHER_PROCESS) return 0;
if (wParam)
{
if (!(pWnd->flags & WIN_NEEDS_SHOW_OWNEDPOPUP))
{
WIN_ReleasePtr( pWnd );
return 0;
}
pWnd->flags &= ~WIN_NEEDS_SHOW_OWNEDPOPUP;
}
else pWnd->flags |= WIN_NEEDS_SHOW_OWNEDPOPUP;
WIN_ReleasePtr( pWnd );
NtUserShowWindow( hwnd, wParam ? SW_SHOWNOACTIVATE : SW_HIDE );
break;
}
default:
return NtUserMessageCall( hwnd, msg, wParam, lParam, 0, NtUserDefWindowProc, FALSE );
}
return 0;
}
static LPARAM DEFWND_GetTextA( WND *wndPtr, LPSTR dest, WPARAM wParam ) static LPARAM DEFWND_GetTextA( WND *wndPtr, LPSTR dest, WPARAM wParam )
{ {
LPARAM result = 0; LPARAM result = 0;
...@@ -184,6 +133,18 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ...@@ -184,6 +133,18 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
} }
break; break;
case WM_NCMOUSEMOVE:
result = NC_HandleNCMouseMove( hwnd, wParam, lParam );
break;
case WM_NCMOUSELEAVE:
result = NC_HandleNCMouseLeave( hwnd );
break;
case WM_SYSCOMMAND:
result = NC_HandleSysCommand( hwnd, wParam, lParam );
break;
case WM_GETTEXTLENGTH: case WM_GETTEXTLENGTH:
{ {
WND *wndPtr = WIN_GetPtr( hwnd ); WND *wndPtr = WIN_GetPtr( hwnd );
...@@ -207,11 +168,6 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ...@@ -207,11 +168,6 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
} }
break; break;
case WM_SETTEXT:
case WM_SYSCHAR:
result = NtUserMessageCall( hwnd, msg, wParam, lParam, 0, NtUserDefWindowProc, TRUE );
break;
case WM_IME_CHAR: case WM_IME_CHAR:
if (HIBYTE(wParam)) PostMessageA( hwnd, WM_CHAR, HIBYTE(wParam), lParam ); if (HIBYTE(wParam)) PostMessageA( hwnd, WM_CHAR, HIBYTE(wParam), lParam );
PostMessageA( hwnd, WM_CHAR, LOBYTE(wParam), lParam ); PostMessageA( hwnd, WM_CHAR, LOBYTE(wParam), lParam );
...@@ -281,7 +237,7 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ...@@ -281,7 +237,7 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
break; break;
default: default:
result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam ); result = NtUserMessageCall( hwnd, msg, wParam, lParam, 0, NtUserDefWindowProc, TRUE );
break; break;
} }
...@@ -357,6 +313,18 @@ LRESULT WINAPI DefWindowProcW( ...@@ -357,6 +313,18 @@ LRESULT WINAPI DefWindowProcW(
} }
break; break;
case WM_NCMOUSEMOVE:
result = NC_HandleNCMouseMove( hwnd, wParam, lParam );
break;
case WM_NCMOUSELEAVE:
result = NC_HandleNCMouseLeave( hwnd );
break;
case WM_SYSCOMMAND:
result = NC_HandleSysCommand( hwnd, wParam, lParam );
break;
case WM_GETTEXTLENGTH: case WM_GETTEXTLENGTH:
{ {
WND *wndPtr = WIN_GetPtr( hwnd ); WND *wndPtr = WIN_GetPtr( hwnd );
...@@ -431,7 +399,7 @@ LRESULT WINAPI DefWindowProcW( ...@@ -431,7 +399,7 @@ LRESULT WINAPI DefWindowProcW(
break; break;
default: default:
result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam ); result = NtUserMessageCall( hwnd, msg, wParam, lParam, 0, NtUserDefWindowProc, FALSE );
break; break;
} }
SPY_ExitMessage( SPY_RESULT_DEFWND, hwnd, msg, result, wParam, lParam ); SPY_ExitMessage( SPY_RESULT_DEFWND, hwnd, msg, result, wParam, lParam );
......
...@@ -2530,6 +2530,31 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, ...@@ -2530,6 +2530,31 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
handle_set_cursor( hwnd, wparam, lparam ); handle_set_cursor( hwnd, wparam, lparam );
break; break;
case WM_SHOWWINDOW:
{
LONG style = get_window_long( hwnd, GWL_STYLE );
WND *win;
if (!lparam) break; /* sent from ShowWindow */
if ((style & WS_VISIBLE) && wparam) break;
if (!(style & WS_VISIBLE) && !wparam) break;
if (!get_window_relative( hwnd, GW_OWNER )) break;
if (!(win = get_win_ptr( hwnd ))) break;
if (win == WND_OTHER_PROCESS) break;
if (wparam)
{
if (!(win->flags & WIN_NEEDS_SHOW_OWNEDPOPUP))
{
release_win_ptr( win );
break;
}
win->flags &= ~WIN_NEEDS_SHOW_OWNEDPOPUP;
}
else win->flags |= WIN_NEEDS_SHOW_OWNEDPOPUP;
release_win_ptr( win );
NtUserShowWindow( hwnd, wparam ? SW_SHOWNOACTIVATE : SW_HIDE );
break;
}
case WM_CTLCOLORMSGBOX: case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT: case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX: case WM_CTLCOLORLISTBOX:
......
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