CppWebBrowser不响应键盘的问题

jumpaliao 2006-12-15 02:35:29
如题,我知道有dephi的解决方法,但素转换失败。。。其实是可耻地没看懂。。。还请各位DX不吝赐教
...全文
146 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jumpaliao 2006-12-17
  • 打赏
  • 举报
回复
呃。。。是不是周末人比较少。。。
jumpaliao 2006-12-15
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/4999/4999414.xml?temp=.1941645

http://blog.csdn.net/TechnoFantasy/archive/2005/06/29/407558.aspx

第一个链接的解决代码如下


procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
const
StdKeys = [VK_TAB, VK_RETURN]; { standard keys }
ExtKeys = [VK_DELETE, VK_BACK, VK_LEFT, VK_RIGHT]; { extended keys }
fExtended = $01000000; { extended key flag }
begin
Handled := False;
with Msg do
if ((Message >= WM_KEYFIRST) and (Message <= WM_KEYLAST)) and
((wParam in StdKeys) or
(wParam in ExtKeys) and ((lParam and fExtended) = fExtended)) then
try
if IsChild(WebBrowser1.Handle, hWnd) then
begin
with WebBrowser1.Application as IOleInPlaceActiveObject do
Handled := TranslateAccelerator(Msg) = S_OK;
if not Handled then
begin
Handled := True;
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;
except
end;
end;
wood542344 2006-12-15
  • 打赏
  • 举报
回复
友情UP一下。把Delphi的帖出来看看。

13,824

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧