FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Program in execution
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Program in execution
Posted: Tue Apr 12, 2011 02:25 PM

How i can know if a especific program are in execution?

if GetModuleHandle( "UNI.EXE" ) != 0
MsgInfo( "UNI.EXE is running" )
endif

Always return 0

Thanks in advance.

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Program in execution
Posted: Tue Apr 12, 2011 03:39 PM

Try

IF ISEXERUNNING( CFILENAME( HB_ARGV( 0 ) ) )
//.... exe is running // RETURN NIL
ENDIF

Hth

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Program in execution
Posted: Tue Apr 12, 2011 03:58 PM
Richard Chidiak wrote:Try

IF ISEXERUNNING( CFILENAME( HB_ARGV( 0 ) ) )
//.... exe is running // RETURN NIL
ENDIF

Hth


HI Richard, thanks for answer but i cant understand where i can put the exe name in this example.
The .exe i want to know about execution is not my application, is a application running in windows process.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Program in execution
Posted: Tue Apr 12, 2011 05:32 PM

Try replacing HB_ARGV( 0 ) with the name of the EXE to test for execution.

EMG

Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Program in execution
Posted: Tue Apr 12, 2011 06:07 PM
Enrico Maria Giordano wrote:Try replacing HB_ARGV( 0 ) with the name of the EXE to test for execution.

EMG


Perfect Enrico, thank you!

Continue the discussion