Commit 51624900 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserFlashWindowEx implementation from user32.

parent e3b1d818
......@@ -156,10 +156,6 @@ static void CDECL nulldrv_DestroyWindow( HWND hwnd )
{
}
static void CDECL nulldrv_FlashWindowEx( FLASHWINFO *info )
{
}
static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
const RECT *top_rect, DWORD flags )
{
......@@ -267,11 +263,6 @@ static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd )
return load_driver()->pCreateWindow( hwnd );
}
static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info )
{
load_driver()->pFlashWindowEx( info );
}
static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
const RECT *top_rect, DWORD flags )
{
......@@ -323,7 +314,7 @@ static struct user_driver_funcs lazy_load_driver =
loaderdrv_CreateDesktopWindow,
loaderdrv_CreateWindow,
nulldrv_DestroyWindow,
loaderdrv_FlashWindowEx,
NULL,
loaderdrv_GetDC,
nulldrv_MsgWaitForMultipleObjectsEx,
nulldrv_ReleaseDC,
......@@ -373,7 +364,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v
SET_USER_FUNC(CreateDesktopWindow);
SET_USER_FUNC(CreateWindow);
SET_USER_FUNC(DestroyWindow);
SET_USER_FUNC(FlashWindowEx);
SET_USER_FUNC(GetDC);
SET_USER_FUNC(MsgWaitForMultipleObjectsEx);
SET_USER_FUNC(ReleaseDC);
......
......@@ -245,7 +245,7 @@
@ stdcall FindWindowExW(long long wstr wstr)
@ stdcall FindWindowW(wstr wstr)
@ stdcall FlashWindow(long long)
@ stdcall FlashWindowEx(ptr)
@ stdcall FlashWindowEx(ptr) NtUserFlashWindowEx
@ stdcall FrameRect(long ptr long)
@ stdcall FreeDDElParam(long long)
@ stdcall GetActiveWindow()
......
......@@ -140,6 +140,7 @@ static const struct user_callbacks user_funcs =
GetWindowRect,
RedrawWindow,
SendMessageTimeoutW,
SendMessageW,
WindowFromDC,
free_dce,
MSG_SendInternalMessageTimeout,
......
......@@ -3230,67 +3230,9 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
finfo.uCount = 1;
finfo.dwTimeout = 0;
finfo.hwnd = hWnd;
return FlashWindowEx( &finfo );
return NtUserFlashWindowEx( &finfo );
}
/*******************************************************************
* FlashWindowEx (USER32.@)
*/
BOOL WINAPI FlashWindowEx( PFLASHWINFO pfinfo )
{
WND *wndPtr;
TRACE( "%p\n", pfinfo );
if (!pfinfo)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
if (!pfinfo->hwnd || pfinfo->cbSize != sizeof(FLASHWINFO) || !IsWindow( pfinfo->hwnd ))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
FIXME( "%p - semi-stub\n", pfinfo );
if (IsIconic( pfinfo->hwnd ))
{
RedrawWindow( pfinfo->hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_FRAME );
wndPtr = WIN_GetPtr( pfinfo->hwnd );
if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE;
if (pfinfo->dwFlags && !(wndPtr->flags & WIN_NCACTIVATED))
{
wndPtr->flags |= WIN_NCACTIVATED;
}
else
{
wndPtr->flags &= ~WIN_NCACTIVATED;
}
WIN_ReleasePtr( wndPtr );
USER_Driver->pFlashWindowEx( pfinfo );
return TRUE;
}
else
{
WPARAM wparam;
HWND hwnd = pfinfo->hwnd;
wndPtr = WIN_GetPtr( hwnd );
if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE;
hwnd = wndPtr->obj.handle; /* make it a full handle */
if (pfinfo->dwFlags) wparam = !(wndPtr->flags & WIN_NCACTIVATED);
else wparam = (hwnd == NtUserGetForegroundWindow());
WIN_ReleasePtr( wndPtr );
SendMessageW( hwnd, WM_NCACTIVATE, wparam, 0 );
USER_Driver->pFlashWindowEx( pfinfo );
return wparam;
}
}
/*******************************************************************
* GetWindowContextHelpId (USER32.@)
......
......@@ -1032,6 +1032,11 @@ static void CDECL loaderdrv_UpdateDisplayDevices( const struct gdi_device_manage
load_driver()->pUpdateDisplayDevices( manager, force, param );
}
static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info )
{
load_driver()->pFlashWindowEx( info );
}
static const struct vulkan_funcs * CDECL loaderdrv_wine_get_vulkan_driver( UINT version )
{
return load_driver()->pwine_get_vulkan_driver( version );
......@@ -1062,6 +1067,7 @@ static const struct user_driver_funcs lazy_load_driver =
.pEnumDisplaySettingsEx = loaderdrv_EnumDisplaySettingsEx,
.pUpdateDisplayDevices = loaderdrv_UpdateDisplayDevices,
/* windowing functions */
.pFlashWindowEx = loaderdrv_FlashWindowEx,
.pMsgWaitForMultipleObjectsEx = nulldrv_MsgWaitForMultipleObjectsEx,
.pScrollDC = nulldrv_ScrollDC,
.pWindowMessage = nulldrv_WindowMessage,
......
......@@ -1164,6 +1164,7 @@ static struct unix_funcs unix_funcs =
NtUserEnumDisplayDevices,
NtUserEnumDisplayMonitors,
NtUserEnumDisplaySettings,
NtUserFlashWindowEx,
NtUserGetAsyncKeyState,
NtUserGetClassInfoEx,
NtUserGetCursorInfo,
......
......@@ -101,3 +101,11 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info )
SERVER_END_REQ;
return ret;
}
/* see SendMessageW */
LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
/* FIXME: move implementation from user32 */
if (!user_callbacks) return 0;
return user_callbacks->pSendMessageW( hwnd, msg, wparam, lparam );
}
......@@ -34,6 +34,7 @@ struct user_callbacks
BOOL (WINAPI *pGetWindowRect)( HWND hwnd, LPRECT rect );
BOOL (WINAPI *pRedrawWindow)( HWND, const RECT*, HRGN, UINT );
LRESULT (WINAPI *pSendMessageTimeoutW)( HWND, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
LRESULT (WINAPI *pSendMessageW)( HWND, UINT, WPARAM, LPARAM );
HWND (WINAPI *pWindowFromDC)( HDC );
void (WINAPI *free_dce)( struct dce *dce, HWND hwnd );
LRESULT (WINAPI *send_ll_message)( DWORD, DWORD, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
......
......@@ -883,7 +883,7 @@
@ stub NtUserFillWindow
@ stdcall -syscall NtUserFindExistingCursorIcon(ptr ptr ptr)
@ stub NtUserFindWindowEx
@ stub NtUserFlashWindowEx
@ stdcall NtUserFlashWindowEx(ptr)
@ stub NtUserForceWindowToDpiForTest
@ stub NtUserFrostCrashedWindow
@ stub NtUserFunctionalizeDisplayConfig
......
......@@ -202,6 +202,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserEnumDisplayMonitors)( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
BOOL (WINAPI *pNtUserEnumDisplaySettings)( UNICODE_STRING *device, DWORD mode,
DEVMODEW *dev_mode, DWORD flags );
BOOL (WINAPI *pNtUserFlashWindowEx)( FLASHWINFO *info );
SHORT (WINAPI *pNtUserGetAsyncKeyState)( INT key );
ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc,
struct client_menu_name *menu_name, BOOL ansi );
......@@ -277,6 +278,9 @@ extern LONG global_key_state_counter DECLSPEC_HIDDEN;
extern BOOL get_cursor_pos( POINT *pt ) DECLSPEC_HIDDEN;
extern DWORD get_input_state(void) DECLSPEC_HIDDEN;
/* message.c */
extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
/* sysparams.c */
extern RECT get_display_rect( const WCHAR *display ) DECLSPEC_HIDDEN;
extern UINT get_monitor_dpi( HMONITOR monitor ) DECLSPEC_HIDDEN;
......
......@@ -676,6 +676,11 @@ static LONG_PTR get_win_data( const void *ptr, UINT size )
}
}
static BOOL is_iconic( HWND hwnd )
{
return (get_window_long( hwnd, GWL_STYLE ) & WS_MINIMIZE) != 0;
}
static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ansi )
{
LONG_PTR retval = 0;
......@@ -990,6 +995,65 @@ INT WINAPI NtUserInternalGetWindowText( HWND hwnd, WCHAR *text, INT count )
return lstrlenW(text);
}
/*******************************************************************
* NtUserFlashWindowEx (win32u.@)
*/
BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
{
WND *win;
TRACE( "%p\n", info );
if (!info)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
if (!info->hwnd || info->cbSize != sizeof(FLASHWINFO) || !is_window( info->hwnd ))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
FIXME( "%p - semi-stub\n", info );
if (is_iconic( info->hwnd ))
{
user_callbacks->pRedrawWindow( info->hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_FRAME );
win = get_win_ptr( info->hwnd );
if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return FALSE;
if (info->dwFlags && !(win->flags & WIN_NCACTIVATED))
{
win->flags |= WIN_NCACTIVATED;
}
else
{
win->flags &= ~WIN_NCACTIVATED;
}
release_win_ptr( win );
user_driver->pFlashWindowEx( info );
return TRUE;
}
else
{
WPARAM wparam;
HWND hwnd = info->hwnd;
win = get_win_ptr( hwnd );
if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return FALSE;
hwnd = win->obj.handle; /* make it a full handle */
if (info->dwFlags) wparam = !(win->flags & WIN_NCACTIVATED);
else wparam = (hwnd == NtUserGetForegroundWindow());
release_win_ptr( win );
send_message( hwnd, WM_NCACTIVATE, wparam, 0 );
user_driver->pFlashWindowEx( info );
return wparam;
}
}
/*****************************************************************************
* NtUserCallHwnd (win32u.@)
*/
......
......@@ -789,6 +789,12 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
return unix_funcs->pNtUserEnumDisplaySettings( device, mode, dev_mode, flags );
}
BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserFlashWindowEx( info );
}
SHORT WINAPI NtUserGetAsyncKeyState( INT key )
{
if (!unix_funcs) return 0;
......
......@@ -279,6 +279,7 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
DEVMODEW *dev_mode, DWORD flags );
HICON WINAPI NtUserFindExistingCursorIcon( UNICODE_STRING *module, UNICODE_STRING *res_name,
void *desc );
BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info );
HWND WINAPI NtUserGetAncestor( HWND hwnd, UINT type );
SHORT WINAPI NtUserGetAsyncKeyState( INT key );
ULONG WINAPI NtUserGetAtomName( ATOM atom, UNICODE_STRING *name );
......
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