Hi Stephen,

you should have a look at the

CreateToolHelp32Snapshot()

and

Process32First() / Process32Next()

API calls.

Best wishes,
Gunnar


Gunnar Blumert Softwareentwicklung
Waldstr. 117
25712 Burg (Dithmarschen)
Germany
Tel. +49-(0)4825-2892 (14.00-16.00h)
Fax: +49-(0)4825-1217
Email [email protected]
www.blumert.de

----- Original Message ----- 
From: "Stephen Bowker" <[email protected]>
To: "Delphi (E-mail)" <[email protected]>
Sent: Monday, January 26, 2009 4:14 PM
Subject: Check if specific EXE is running and close/open it


> Hi,
> I'm trying to write a program that checks if a specific EXE file is 
> running. If it is, then I need to close it, copy over the latest version, 
> and then run it again,
> Can anyone give me some help with whatever windows API calls I need to use 
> (or if there any existing Delphi functions/procedures I can use)
> My code would ideally look like the following, so would need the code for 
> the functions I'm calling...
> if ExeIsRunning('SPECIFIC.EXE') then
>  begin
>  CloseRunningExe('SPECIFIC.EXE');
>  // do my stuff here - already know what I am doing here!
>  OpenExeAgain('SPECIFIC.EXE'); // Can prob guess that I use ShellExecute 
> here?
>  end
> else
>  // do my stuff here - already know what I am doing here!
> PS - I am using Delphi 5 in a Win32 environment
> Thank in advance for any help
> Regards,
> Steve B.
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://lists.elists.org/cgi-bin/mailman/listinfo/delphi 

_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to