描述:
DLL里面有一个Dialog,里面嵌入了IE控件,对话框派生自 CAxDialogImpl<xxx>, 现在的问题是,当对话以DoModal方式显示时,无法在IE控件里面相应键盘事件。
急,请高手提供思路,谢谢!
解决方案1:
实在没有办法.用 hook
解决方案2: Sometimes your application will not automatically be sent WM_KEYDOWN messages for accelerator keys. In this case, you must manually send this message to your window. Here is a sample message pump that sends all keyboard messages to the window of your application:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
// Send all keyboard messages to the window of your
// application. hwndApp is the window handle of
// your application.
//
if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST)
::SendMessage(hwndApp, msg.message, msg.wParam, msg.lParam);
DispatchMessage(&msg);
}
你可以在pretransmsg给iwebrose的窗口转发键盘消息。
web->get_hwnd()