Commit 12a6f8d4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Partially move WM_SYSCOMMAND implementation from user32.

parent c31954df
...@@ -69,11 +69,6 @@ static void CDECL nulldrv_UpdateClipboard(void) ...@@ -69,11 +69,6 @@ static void CDECL nulldrv_UpdateClipboard(void)
{ {
} }
static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
{
return -1;
}
/********************************************************************** /**********************************************************************
* Lazy loading user driver * Lazy loading user driver
...@@ -130,7 +125,7 @@ static struct user_driver_funcs lazy_load_driver = ...@@ -130,7 +125,7 @@ static struct user_driver_funcs lazy_load_driver =
NULL, NULL,
NULL, NULL,
NULL, NULL,
nulldrv_SysCommand, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
...@@ -162,7 +157,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v ...@@ -162,7 +157,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v
do { if (!driver->p##name) driver->p##name = nulldrv_##name; } while(0) do { if (!driver->p##name) driver->p##name = nulldrv_##name; } while(0)
SET_USER_FUNC(UpdateClipboard); SET_USER_FUNC(UpdateClipboard);
SET_USER_FUNC(SysCommand);
#undef SET_USER_FUNC #undef SET_USER_FUNC
prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver ); prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
......
...@@ -1540,12 +1540,7 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) ...@@ -1540,12 +1540,7 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
{ {
TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", hwnd, wParam, lParam ); TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", hwnd, wParam, lParam );
if (!IsWindowEnabled( hwnd )) return 0; if (!NtUserMessageCall( hwnd, WM_SYSCOMMAND, wParam, lParam, 0, FNID_DEFWINDOWPROC, FALSE ))
if (HOOK_CallHooks( WH_CBT, HCBT_SYSCOMMAND, wParam, lParam, TRUE ))
return 0;
if (!USER_Driver->pSysCommand( hwnd, wParam, lParam ))
return 0; return 0;
switch (wParam & 0xfff0) switch (wParam & 0xfff0)
......
...@@ -121,6 +121,18 @@ static HICON set_window_icon( HWND hwnd, WPARAM type, HICON icon ) ...@@ -121,6 +121,18 @@ static HICON set_window_icon( HWND hwnd, WPARAM type, HICON icon )
return ret; return ret;
} }
static LRESULT handle_sys_command( HWND hwnd, WPARAM wparam, LPARAM lparam )
{
if (!is_window_enabled( hwnd )) return 0;
if (call_hooks( WH_CBT, HCBT_SYSCOMMAND, wparam, lparam, TRUE ))
return 0;
if (!user_driver->pSysCommand( hwnd, wparam, lparam ))
return 0;
return 1;
}
LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi )
{ {
...@@ -156,6 +168,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, ...@@ -156,6 +168,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
case WM_SETICON: case WM_SETICON:
result = (LRESULT)set_window_icon( hwnd, wparam, (HICON)lparam ); result = (LRESULT)set_window_icon( hwnd, wparam, (HICON)lparam );
break; break;
case WM_SYSCOMMAND:
result = handle_sys_command( hwnd, wparam, lparam );
break;
} }
return result; return result;
......
...@@ -410,6 +410,7 @@ extern HWND is_current_process_window( HWND hwnd ) DECLSPEC_HIDDEN; ...@@ -410,6 +410,7 @@ extern HWND is_current_process_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND is_current_thread_window( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND is_current_thread_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN; extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_iconic( HWND hwnd ) DECLSPEC_HIDDEN; extern BOOL is_iconic( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_window_enabled( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_window_unicode( HWND hwnd ) DECLSPEC_HIDDEN; extern BOOL is_window_unicode( HWND hwnd ) DECLSPEC_HIDDEN;
extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN; extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN; extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN;
......
...@@ -808,7 +808,7 @@ BOOL is_window_unicode( HWND hwnd ) ...@@ -808,7 +808,7 @@ BOOL is_window_unicode( HWND hwnd )
} }
/* see IsWindowEnabled */ /* see IsWindowEnabled */
static BOOL is_window_enabled( HWND hwnd ) BOOL is_window_enabled( HWND hwnd )
{ {
LONG ret; LONG ret;
......
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