user32: Fix F1 message sequence.
This commit is contained in:
parent
5d038523e9
commit
d8391a4a46
|
@ -723,6 +723,29 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
|
|||
SendMessageW( parent, msg, wParam, lParam );
|
||||
break;
|
||||
}
|
||||
case WM_KEYF1:
|
||||
{
|
||||
HELPINFO hi;
|
||||
|
||||
hi.cbSize = sizeof(HELPINFO);
|
||||
GetCursorPos( &hi.MousePos );
|
||||
if (MENU_IsMenuActive())
|
||||
{
|
||||
hi.iContextType = HELPINFO_MENUITEM;
|
||||
hi.hItemHandle = MENU_IsMenuActive();
|
||||
hi.iCtrlId = MenuItemFromPoint( hwnd, hi.hItemHandle, hi.MousePos );
|
||||
hi.dwContextId = GetMenuContextHelpId( hi.hItemHandle );
|
||||
}
|
||||
else
|
||||
{
|
||||
hi.iContextType = HELPINFO_WINDOW;
|
||||
hi.hItemHandle = hwnd;
|
||||
hi.iCtrlId = GetWindowLongPtrA( hwnd, GWLP_ID );
|
||||
hi.dwContextId = GetWindowContextHelpId( hwnd );
|
||||
}
|
||||
SendMessageW( hwnd, WM_HELP, 0, (LPARAM)&hi );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1702,17 +1702,9 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter,
|
|||
(msg->hwnd != GetDesktopWindow()))
|
||||
{
|
||||
/* Handle F1 key by sending out WM_HELP message */
|
||||
if(msg->wParam == VK_F1 &&
|
||||
!MENU_IsMenuActive())
|
||||
if (msg->wParam == VK_F1)
|
||||
{
|
||||
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 );
|
||||
PostMessageW( msg->hwnd, WM_KEYF1, 0, 0 );
|
||||
}
|
||||
else if(msg->wParam >= VK_BROWSER_BACK &&
|
||||
msg->wParam <= VK_LAUNCH_APP2)
|
||||
|
|
|
@ -5891,8 +5891,8 @@ static const struct message WmF1Seq[] = {
|
|||
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F1, 1 }, /* XP */
|
||||
{ WM_KEYDOWN, wparam|lparam, VK_F1, 1 },
|
||||
{ WM_KEYDOWN, sent|wparam|lparam, VK_F1, 0x00000001 },
|
||||
{ 0x4d, wparam|lparam, 0, 0 },
|
||||
{ 0x4d, sent|wparam|lparam, 0, 0 },
|
||||
{ WM_KEYF1, wparam|lparam, 0, 0 },
|
||||
{ WM_KEYF1, sent|wparam|lparam, 0, 0 },
|
||||
{ WM_HELP, sent|defwinproc },
|
||||
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F1, 0xc0000001 }, /* XP */
|
||||
{ WM_KEYUP, wparam|lparam, VK_F1, 0xc0000001 },
|
||||
|
@ -6123,7 +6123,7 @@ static void test_accelerators(void)
|
|||
keybd_event(VK_F1, 0, 0, 0);
|
||||
keybd_event(VK_F1, 0, KEYEVENTF_KEYUP, 0);
|
||||
pump_msg_loop(hwnd, 0);
|
||||
ok_sequence(WmF1Seq, "F1 press/release", TRUE);
|
||||
ok_sequence(WmF1Seq, "F1 press/release", FALSE);
|
||||
|
||||
trace("testing VK_APPS press/release\n");
|
||||
keybd_event(VK_APPS, 0, 0, 0);
|
||||
|
|
|
@ -1160,6 +1160,7 @@ WINUSERAPI BOOL WINAPI SetSysColors(INT,const INT*,const COLORREF*);
|
|||
/* Win32 4.0 messages */
|
||||
#define WM_COPYDATA 0x004a
|
||||
#define WM_CANCELJOURNAL 0x004b
|
||||
#define WM_KEYF1 0x004d
|
||||
#define WM_NOTIFY 0x004e
|
||||
#define WM_INPUTLANGCHANGEREQUEST 0x0050
|
||||
#define WM_INPUTLANGCHANGE 0x0051
|
||||
|
|
Loading…
Reference in New Issue