最原始的bho代码,,创建IEtoolbar ,按钮的单元为IEToolBar,如下代码:
建一个弹出菜单,ShowMessage可以弹出;vvFrm 为令一个窗体,弹出时候报错!!
??对弹出窗体有什么特殊要求吗??谢谢拉
unit IEToolBar;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TFlatButtonUnit,SHDocVw, TFlatSpeedButtonUnit, Menus;
type
TieFrm = class(TForm)
flatBtn: TFlatButton;
FlatSpeedButton1: TFlatSpeedButton;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
procedure FlatSpeedButton1Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
private
{ Private declarations }
public
IEThis:IWebbrowser2
{ Public declarations }
end;
implementation
{$R *.dfm}
uses FovFrm;
var
vvFrm : TMainFrm;
procedure TieFrm.FlatSpeedButton1Click(Sender: TObject);
var
myP: TPoint;
showY: Integer;
begin
GetCursorPos(myP);
showY := self.FlatSpeedButton1.Top + self.FlatSpeedButton1.Height;
PopupMenu1.Popup( myP.X , showY );
end;
procedure TieFrm.N1Click(Sender: TObject);
begin
ShowMessage('测试弹出');
end;
procedure TieFrm.N2Click(Sender: TObject);
begin
vvFrm.Show;
end;
end.