Program in execution

Program in execution

Postby Wanderson » Tue Apr 12, 2011 2: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.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Program in execution

Postby Richard Chidiak » Tue Apr 12, 2011 3: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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Program in execution

Postby Wanderson » Tue Apr 12, 2011 3: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.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Program in execution

Postby Enrico Maria Giordano » Tue Apr 12, 2011 5:32 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Program in execution

Postby Wanderson » Tue Apr 12, 2011 6: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!
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 95 guests