admin 管理员组

文章数量: 887021

WM

构造F1的WM_KEYDOWN的lParam:

0x1 | (MapVirtualKey(VK_F1, MAPVK_VK_TO_VSC) << 16)

如果Alt也按下

0x1 | ((KF_ALTDOWN|MapVirtualKey(VK_MENU, MAPVK_VK_TO_VSC)) << 16)


构造F1的WM_KEYUP的lParam:

0x1 | ((KF_REPEAT|KF_UP|MapVirtualKey(VK_F1, MAPVK_VK_TO_VSC)) << 16)

如果Alt也按下:

0x1 | ((KF_ALTDOWN|KF_REPEAT|KF_UP|MapVirtualKey(VK_MENU, MAPVK_VK_TO_VSC)) << 16)


使用:

::PostMessage(activeWnd->m_hWnd,WM_KEYDOWN,'V',0x1|(MapVirtualKey('V', MAPVK_VK_TO_VSC) << 16));
::PostMessage(activeWnd->m_hWnd,WM_KEYUP,'V',0x1 | ((KF_REPEAT|KF_UP|MapVirtualKey('V', MAPVK_VK_TO_VSC)) << 16));


转自:

本文标签: WM