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

win32u: Move NtUserSetSystemMenu implementation from user32.

parent 4604c455
......@@ -3925,24 +3925,6 @@ HMENU WINAPI CreateMenu(void)
}
/*******************************************************************
* SetSystemMenu (USER32.@)
*/
BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
{
WND *wndPtr = WIN_GetPtr( hwnd );
if (wndPtr && wndPtr != WND_OTHER_PROCESS && wndPtr != WND_DESKTOP)
{
if (wndPtr->hSysMenu) NtUserDestroyMenu( wndPtr->hSysMenu );
wndPtr->hSysMenu = MENU_GetSysMenu( hwnd, hMenu );
WIN_ReleasePtr( wndPtr );
return TRUE;
}
return FALSE;
}
/**********************************************************************
* GetMenu (USER32.@)
*/
......
......@@ -707,7 +707,7 @@
@ stdcall SetSysColors(long ptr ptr) NtUserSetSysColors
@ stdcall SetSysColorsTemp(ptr ptr long)
@ stdcall SetSystemCursor(long long)
@ stdcall SetSystemMenu(long long)
@ stdcall SetSystemMenu(long long) NtUserSetSystemMenu
@ stdcall SetSystemTimer(long long long ptr)
@ stdcall SetTaskmanWindow (long)
@ stdcall SetThreadDesktop(long) NtUserSetThreadDesktop
......
......@@ -164,7 +164,6 @@ static const struct user_callbacks user_funcs =
EndMenu,
ImmProcessKey,
ImmTranslateMessage,
SetSystemMenu,
free_win_ptr,
MENU_GetSysMenu,
MENU_IsMenuActive,
......
......@@ -1212,6 +1212,7 @@ static struct unix_funcs unix_funcs =
NtUserSetMenu,
NtUserSetParent,
NtUserSetSysColors,
NtUserSetSystemMenu,
NtUserSetWindowLong,
NtUserSetWindowLongPtr,
NtUserSetWindowPos,
......
......@@ -466,14 +466,6 @@ BOOL WINAPI NtUserDestroyMenu( HMENU handle )
}
/*******************************************************************
* NtUserSetSystemMenu (win32u.@)
*/
BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu )
{
return user_callbacks && user_callbacks->pSetSystemMenu( hwnd, menu );
}
/*******************************************************************
* set_window_menu
*
* Helper for NtUserSetMenu that does not call NtUserSetWindowPos.
......@@ -1073,6 +1065,21 @@ HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert )
}
/**********************************************************************
* NtUserSetSystemMenu (win32u.@)
*/
BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu )
{
WND *win = get_win_ptr( hwnd );
if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return FALSE;
if (win->hSysMenu) NtUserDestroyMenu( win->hSysMenu );
win->hSysMenu = user_callbacks ? user_callbacks->get_sys_menu( hwnd, menu ) : NULL;
release_win_ptr( win );
return TRUE;
}
/**********************************************************************
* NtUserSetMenuDefaultItem (win32u.@)
*/
BOOL WINAPI NtUserSetMenuDefaultItem( HMENU handle, UINT item, UINT bypos )
......
......@@ -37,7 +37,6 @@ struct user_callbacks
BOOL (WINAPI *pEndMenu)(void);
BOOL (WINAPI *pImmProcessKey)(HWND, HKL, UINT, LPARAM, DWORD);
BOOL (WINAPI *pImmTranslateMessage)(HWND, UINT, WPARAM, LPARAM);
BOOL (WINAPI *pSetSystemMenu)( HWND hwnd, HMENU menu );
void (CDECL *free_win_ptr)( struct tagWND *win );
HMENU (CDECL *get_sys_menu)( HWND hwnd, HMENU popup );
HWND (CDECL *is_menu_active)(void);
......
......@@ -1229,7 +1229,7 @@
@ stub NtUserSetShellWindowEx
@ stdcall NtUserSetSysColors(long ptr ptr)
@ stub NtUserSetSystemCursor
@ stub NtUserSetSystemMenu
@ stdcall NtUserSetSystemMenu(long long)
@ stdcall -syscall NtUserSetSystemTimer(long long long)
@ stub NtUserSetTargetForResourceBrokering
@ stdcall -syscall NtUserSetThreadDesktop(long)
......
......@@ -282,6 +282,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserSetMenu)( HWND hwnd, HMENU menu );
HWND (WINAPI *pNtUserSetParent)( HWND hwnd, HWND parent );
BOOL (WINAPI *pNtUserSetSysColors)( INT count, const INT *colors, const COLORREF *values );
BOOL (WINAPI *pNtUserSetSystemMenu)( HWND hwnd, HMENU menu );
LONG (WINAPI *pNtUserSetWindowLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi );
LONG_PTR (WINAPI *pNtUserSetWindowLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
BOOL (WINAPI *pNtUserSetWindowPos)( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags );
......
......@@ -1185,6 +1185,12 @@ BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *va
return unix_funcs->pNtUserSetSysColors( count, colors, values );
}
BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserSetSystemMenu( hwnd, menu );
}
LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi )
{
if (!unix_funcs) return 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