注册系统热键看看
另外参考
http://www.delphibbs.com/delphibbs/dispq.asp?lid=300135
标题是: IE Webbrowser ActiveX 不支持热键?300分求解!!
1.在包含webbrowser的form中加入:
initialization
OleInitialize(nil);
finalization
OleUninitialize;
如果你用Delphi5/BCB5,问题就已经解决了,不需要再作任何工作,
你现在用BCB4?不知道能否解决,请试验一下。
2.如果不行,(例如Delphi 4)
再使用我那个贴子中的方法或者使用EmbeddedWB中的方法
后者内容如下,但经过我的修改,才能在Form中使用,
(CathyEagle主页上也是用的这一段,但是从EmbeddedWB.pas中copy的,不能直接使用):
procedure TForm1.IEMessageHandler(var Msg: TMsg; var Handled: Boolean);
{ fixes the malfunction of some keys within webbrowser control }
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 {$IFDEF VER120}(GetKeyState(VK_CONTROL) < 0) or {$ENDIF}
(wParam in ExtKeys) and ((lParam and fExtended) = fExtended)) then
try
if IsChild(WebBrowser1.Handle, hWnd) then
{ handles all browser related messages }
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; // IEMessageHandler
另外参考
http://www.delphibbs.com/delphibbs/dispq.asp?lid=291338
标题是: 请问如何建立本进程内生效的Hotkey (100分)