Solved

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

Posted on 2004-09-17
2
148 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 22

Accepted Solution

by:
Ferruccio Accalai earned 150 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

861 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