unit Main;

interface

uses
     //
     wxoExec,
     wxoUnit,
     //
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ToolWin, ImgList;

type
  TForm_WXO = class(TForm)
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ImageList1: TImageList;
    procedure ToolButton1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_WXO: TForm_WXO;

implementation

uses
     Child1;

{$R *.dfm}

procedure TForm_WXO.ToolButton1Click(Sender: TObject);
var
     oC1  : TForm_Child;
     //pHandle:^THandle;
begin
     //pHandle :=@Application.MainForm.ClientHandle;
     //pHandle^:=ClientHandle; ///关键在这一句！      //
     oC1  := TForm_Child.Create(Application);
     oC1.Show;
end;

procedure TForm_WXO.FormShow(Sender: TObject);
var
     pHandle   : ^THandle;
begin
     pHandle   := @Application.MainForm.ClientHandle;
     pHandle^  := ClientHandle;      ///关键在这一句！
end;

procedure TForm_WXO.ToolButton2Click(Sender: TObject);
var
     pHandle   : ^THandle;
begin
     pHandle   := @Application.MainForm.ClientHandle;
     pHandle^  := ClientHandle;      ///关键在这一句！
end;

procedure TForm_WXO.FormCreate(Sender: TObject);
begin
     wxoPrepare(Handle,Application.Handle);
end;

end.
