是EmbeddedWB本身的问题,该控件创建时,将消息全部挂住,于是代码助手无法弹出了
修改方法如下:
找到
constructor TEmbeddedWB.Create(Owner: TComponent);
begin
inherited;
{$IFDEF DELPHI_5_UP}
EnableMessageHandler;
{$ENDIF}
GetDDEVariables;
{$IFDEF DELPHI_6_UP}
{$WARN SYMBOL_DEPRECATED OFF}
{$ENDIF}
DDEHWND := AllocateHWnd(DDEWndProc);
{$IFDEF DELPHI_6_UP}
{$WARN SYMBOL_DEPRECATED OFF}
{$ENDIF}
{---------------------------------------------}
FAbout := 'Embedded Web Browser. ' + SITE_ADDRESS;
FUserAgent := 'Mozilla/4.0(Compatible-EmbeddedWB' + VER_NUM + SITE_ADDRESS;
........ 以下代码省略
然后将其改为
constructor TEmbeddedWB.Create(Owner: TComponent);
begin
inherited;
if not (csDesigning in ComponentState) then
begin
{$IFDEF DELPHI_5_UP}
EnableMessageHandler;
{$ENDIF}
GetDDEVariables;
{$IFDEF DELPHI_6_UP}
{$WARN SYMBOL_DEPRECATED OFF}
{$ENDIF}
DDEHWND := AllocateHWnd(DDEWndProc);
{$IFDEF DELPHI_6_UP}
{$WARN SYMBOL_DEPRECATED OFF}
{$ENDIF}
end;
{---------------------------------------------}
FAbout := 'Embedded Web Browser. ' + SITE_ADDRESS;
FUserAgent := 'Mozilla/4.0(Compatible-EmbeddedWB' + VER_NUM + SITE_ADDRESS;
......以下代码省略
换言之解决方法很简单,就是在设计期不让EmbeddedWB去挂消息
这个操作将使代码助手能够正常弹出,并且程序编译后,设计期状态不存在,也不会影响控件的正常功能