1,183
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var
olePpt: OLEVariant;
begin
try
olePpt := CreateOleObject('PowerPoint.Application');
except
ShowMessage('创建幻灯片应用错误!');
Exit;
end;
olePpt.Visible := True;
olePpt.Presentations.Open(ExtractFilePath(application.ExeName) + 'sample.ppt');
olePpt.ActivePresentation.SlideShowSettings.Run;
end;
procedure TForm1.button1onclick(sender:tobject);
var
p:olevariant;
s:string;
h:hwnd;
begin
P := createoleobject('Powerpoint.Application');
P.visible := true;
s := P.caption;
h := FindWindow(nil,Pchar(s));
windows.SetParent(h,Panel1.Handle);
windows.SetWindowPos(h,HWND_TOP,0,0,Panel1.Width,Panel1.Height,SWP_SHOWWINDOW);
P.Presentations.Open(ExtractFilePath(application.ExeName) + 'sample.ppt');
P.ActivePresentation.SlideShowSettings.Run;
end;
procedure TForm1.button1onclick(sender:tobject);
var
p:olevariant;
s:string;
h:hwnd;
begin
P := createoleobject('Powerpoint.Application');
P.visible := true;
s := P.caption;
h := FindWindow(nil,Pchar(s));
windows.SetParent(h,Panel1.Handle);
windows.SetWindowPos(h,HWND_TOP,0,0,Panel1.Width,Panel1.Height,SWP_SHOWWINDOW);
end;