winemac: Implement SysCommand() to prevent Alt keypresses from activating system menu.

This commit is contained in:
Ken Thomases 2013-02-06 19:32:18 -06:00 committed by Alexandre Julliard
parent 9f6f8bfc00
commit 5f06bf80db
2 changed files with 31 additions and 0 deletions

View File

@ -1040,6 +1040,36 @@ done:
}
/***********************************************************************
* SysCommand (MACDRV.@)
*
* Perform WM_SYSCOMMAND handling.
*/
LRESULT CDECL macdrv_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam)
{
struct macdrv_win_data *data;
LRESULT ret = -1;
TRACE("%p, %x, %lx\n", hwnd, (unsigned)wparam, lparam);
if (!(data = get_win_data(hwnd))) goto done;
if (!data->cocoa_window || !data->on_screen) goto done;
/* prevent a simple ALT press+release from activating the system menu,
as that can get confusing */
if ((wparam & 0xfff0) == SC_KEYMENU && !(WCHAR)lparam && !GetMenu(hwnd) &&
(GetWindowLongW(hwnd, GWL_STYLE) & WS_SYSMENU))
{
TRACE("ignoring SC_KEYMENU wp %lx lp %lx\n", wparam, lparam);
ret = 0;
}
done:
release_win_data(data);
return ret;
}
/***********************************************************************
* UpdateLayeredWindow (MACDRV.@)
*/

View File

@ -24,6 +24,7 @@
@ cdecl SetWindowStyle(ptr long ptr) macdrv_SetWindowStyle
@ cdecl SetWindowText(long wstr) macdrv_SetWindowText
@ cdecl ShowWindow(long long ptr long) macdrv_ShowWindow
@ cdecl SysCommand(long long long) macdrv_SysCommand
@ cdecl ToUnicodeEx(long long ptr ptr long long long) macdrv_ToUnicodeEx
@ cdecl UpdateLayeredWindow(long ptr ptr) macdrv_UpdateLayeredWindow
@ cdecl VkKeyScanEx(long long) macdrv_VkKeyScanEx