* PURPOSE: Window accelerator
* FILE: subsystems/win32/win32k/ntuser/accelerator.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISION HISTORY:
- * 06-06-2001 CSH Created
+ * Copyright 1993 Martin Ayotte
+ * Copyright 1994 Alexandre Julliard
+ * Copyright 1997 Morten Welinder
+ * Copyright 2011 Rafal Harabien
*/
-/*
- * Copyright 1993 Martin Ayotte
- * Copyright 1994 Alexandre Julliard
- * Copyright 1997 Morten Welinder
- * Copyright 2011 Rafal Harabien
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* INCLUDES ******************************************************************/
-
#include <win32k.h>
+DBG_DEFAULT_CHANNEL(UserAccel);
#define FVIRT_TBL_END 0x80
#define FVIRT_MASK 0x7F
-DBG_DEFAULT_CHANNEL(UserAccel);
-
-UINT FASTCALL IntFindSubMenu(HMENU *hMenu, HMENU hSubTarget );
-HMENU FASTCALL IntGetSubMenu( HMENU hMenu, int nPos);
-UINT FASTCALL IntGetMenuState( HMENU hMenu, UINT uId, UINT uFlags);
-
/* FUNCTIONS *****************************************************************/
PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hAccel)
&MenuItem,
NULL);
if (nPos != (UINT)-1)
- hSubMenu = MenuItem->hSubMenu;
+ hSubMenu = SubMenu->head.h;
else
hMenu = NULL;
}
&MenuItem,
NULL);
if (nPos != (UINT)-1)
- hSubMenu = MenuItem->hSubMenu;
+ hSubMenu = SubMenu->head.h;
else
hMenu = NULL;
}
/* If this is a menu item, there is no capturing enabled and
window is not disabled, send WM_INITMENU */
if (hMenu && !IntGetCaptureWindow())
- {
+ {
co_IntSendMessage(hWnd, WM_INITMENU, (WPARAM)hMenu, 0L);
if (hSubMenu)
{
- this is window menu and window is minimized */
if (!(Window->style & WS_DISABLED) &&
!(hMenu && IntGetMenuState(hMenu, pAccel->cmd, MF_BYCOMMAND) & (MF_DISABLED|MF_GRAYED)) &&
- !(hMenu && hMenu == (HMENU)Window->IDMenu && !(Window->style & WS_MINIMIZED)))
+ !(hMenu && hMenu == (HMENU)Window->IDMenu && (Window->style & WS_MINIMIZED)))
{
/* If this is system menu item, send WM_SYSCOMMAND, otherwise send WM_COMMAND */
if (hMenu && hMenu == Window->SystemMenu)
{
if (co_IntTranslateAccelerator(Window, &Message, &Accel->Table[i]))
{
- TRACE("NtUserTranslateAccelerator returns 1\n");
- RETURN( 1);
+ RETURN( 1);
}
/* Undocumented feature... */
if (Window) UserDerefObjectCo(Window);
if (Accel) UserDerefObjectCo(Accel);
- TRACE("NtUserTranslateAccelerator returns 0\n");
+ TRACE("NtUserTranslateAccelerator returns %d\n", _ret_);
UserLeave();
END_CLEANUP;
}