佚名通过本文主要向大家介绍了wm char,sendmessage wm char,postmessage wm char,wm char消息,c wm char等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: CAxDialogImpl无法响应WM_CHAR事件
描述:
解决方案1:
描述:
使用ATL开发ACTIVEX控件.点击一个BUTTON.弹出一个CAxDialogImpl的对话框.此对话框内有一EDIT控件.在CAxDialogImpl中添加WM_CHAR事件.无法响应.在网上找了很多办法均为无效.希望大大给一个真正能解决的办法.
解决方案1:
是
非激活状态的控件不会收到容器转发的消息。
可以用消息钩子自己捕获消息。
http://www.codeguru.com/forum/showthread.php?t=159491
You should add it yourself to your class and fit the characters you need:
BOOL PreTranslateAccelerator(LPMSG pMsg, HRESULT& hRet)
{
if(pMsg->message == WM_KEYDOWN &&
(pMsg->wParam == VK_LEFT ||
pMsg->wParam == VK_RIGHT ||
pMsg->wParam == VK_UP ||
pMsg->wParam == VK_DOWN))
{
hRet = S_FALSE;
return TRUE;
}
//TODO: Add your additional accelerator handling code here
return FALSE;
}