Commit 80db3ad8 authored by Kevin Koltzau's avatar Kevin Koltzau Committed by Alexandre Julliard

user32: Generate WM_APPCOMMAND messages for browser and multimedia keys.

parent 00ad155a
......@@ -711,6 +711,16 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_HELP:
SendMessageW( GetParent(hwnd), msg, wParam, lParam );
break;
case WM_APPCOMMAND:
{
HWND parent = GetParent(hwnd);
if(!parent)
HOOK_CallHooks(WH_SHELL, HSHELL_APPCOMMAND, wParam, lParam, TRUE);
else
SendMessageW( parent, msg, wParam, lParam );
break;
}
}
return 0;
......
......@@ -1637,20 +1637,28 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter,
if (remove)
{
/* Handle F1 key by sending out WM_HELP message */
if ((msg->message == WM_KEYUP) &&
(msg->wParam == VK_F1) &&
(msg->hwnd != GetDesktopWindow()) &&
!MENU_IsMenuActive())
if((msg->message == WM_KEYDOWN) &&
(msg->hwnd != GetDesktopWindow()))
{
HELPINFO hi;
hi.cbSize = sizeof(HELPINFO);
hi.iContextType = HELPINFO_WINDOW;
hi.iCtrlId = GetWindowLongPtrA( msg->hwnd, GWLP_ID );
hi.hItemHandle = msg->hwnd;
hi.dwContextId = GetWindowContextHelpId( msg->hwnd );
hi.MousePos = msg->pt;
SendMessageW( msg->hwnd, WM_HELP, 0, (LPARAM)&hi );
/* Handle F1 key by sending out WM_HELP message */
if(msg->wParam == VK_F1 &&
!MENU_IsMenuActive())
{
HELPINFO hi;
hi.cbSize = sizeof(HELPINFO);
hi.iContextType = HELPINFO_WINDOW;
hi.iCtrlId = GetWindowLongPtrA( msg->hwnd, GWLP_ID );
hi.hItemHandle = msg->hwnd;
hi.dwContextId = GetWindowContextHelpId( msg->hwnd );
hi.MousePos = msg->pt;
SendMessageW( msg->hwnd, WM_HELP, 0, (LPARAM)&hi );
}
else if(msg->wParam >= VK_BROWSER_BACK &&
msg->wParam <= VK_LAUNCH_APP2)
{
/* FIXME: Process keystate */
SendMessageW(msg->hwnd, WM_APPCOMMAND, (WPARAM)msg->hwnd, MAKELPARAM(0, (FAPPCOMMAND_KEY | (msg->wParam - VK_BROWSER_BACK + 1))));
}
}
}
......
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