P
P
pcmaster2015-05-20 10:20:51
Delphi
pcmaster, 2015-05-20 10:20:51

How to open a power point program inside a form in Delphi 7?

You need to open the Power Point program window inside the form, run it in a separate window using the code:
WinExec(pchar('Explorer '+ExtractFileDir(Application.ExeName)+'\123.pptx'), sw_SHOW);
I tried to assign the Power Point program as a child window, and display it on the panel on the form, I wrote like this, I'm not sure what is correct:
Windows.SetParent(WinExec(pchar('Explorer '+ExtractFileDir(Application.ExeName)+'\123.pptx') , sw_SHOW),form1.Panel1.Handle);

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zed, 2015-05-20
@zedxxx

From here:

procedure TForm1.FormClick(Sender: TObject); //при клике на форме
var h:hwnd;     //указатель на окно
begin
//запускаем стандартную "командную строку"
  ShellExecute(form1.Handle,'open','cmd.exe',nil,'c:\\windows\system32\',SW_SHOW);
  sleep(10); //ждём, пока окно не появится
  //находим окно по заголовку
  h:=findwindow(nil, 'c:\\windows\system32\cmd.exe');
  //если нашли, присваиваем ему статус дочернего от нашего окошка
  if h<>0 then windows.SetParent(h,form1.Handle);
end;

A
Alexander Krasnov, 2015-05-20
@Pompeius_Magnus

Write to qt.
Delphi is not needed.

M
Mercury13, 2015-05-20
@Mercury13

1. You need a PowerPoint ActiveX component.
I haven't done it yet, so I can't give you the exact recipe.
2. WinExec - isn't this function deprecated in favor of CreateProcess and ShellExecuteEx?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question