Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to start a exe when the first exe is done?

Posted on 2004-09-17
2
Medium Priority
?
153 Views
Last Modified: 2011-04-14
Hello i am doing an intro to a game, and my program first to play up a video.exe file. I am using bink so its a exe. And when that exe is done, I want a game.exe to start. I tried with

run := FindWindow('BinkWin', 'Bink Video Player');
if run < 1 then
//start game

without sucsess, Have someone an idé?
0
Comment
Question by:fjocke
2 Comments
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 450 total points
ID: 12088759
function CreateProcessSimple(sExecutableFilePath : string ):DWORD
  var
   pi: TProcessInformation;
   si: TStartupInfo;
  begin
   FillMemory( @si, sizeof( si ), 0 );
   si.cb := sizeof( si );
   try
    CreateProcess(Nil, PChar( sExecutableFilePath ),
                  Nil, Nil, False, NORMAL_PRIORITY_CLASS,
                  Nil, Nil, si, pi );

   WaitForSingleObject(pi.hProcess, INFINITE);
   finally
   CloseHandle( pi.hProcess );
   CloseHandle( pi.hThread );
   end;
end;

use it as
CreateProcessSimple(BinkWin.exe);
//when it will finishes then
// Start game
0
 
LVL 6

Expert Comment

by:Sergio_Hdez
ID: 12110287
If the first exe is in HD (not CD) maybe you can also try to open it as a file in "exclusive" mode, so as long as it is executing, you will fail (try finally loop) and it you success, then you know the process have finished... but better try the Ferruccio68 way first, it is the good one!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Screencast - Getting to Know the Pipeline

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question