Answer the question
In order to leave comments, you need to log in
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
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;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question