FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour isexerunning (Solved)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: isexerunning
Posted: Sun May 06, 2012 03:52 PM

Yes, you can. That's just what my sample does. I use it in my applications.

EMG

Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: isexerunning
Posted: Sun May 06, 2012 04:48 PM

EMG, all solutions posted works, but dont change the focus and max the first instance, see this video, with tutor01:

http://youtu.be/HZ_-tw_qTpU

another instance is detected, but not focused, only if i click on it.

in video i missing change name of exe, but here the code:

// Typical Welcome message, from Windows!

// FWVERSION, FWCOPYRIGHT and FWDESCRIPTION are just
// some defines placed at FiveWin.ch

include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

IF ISEXERUNNING( CFILENOEXT( HB_ARGV( 0 ) ) )
SHOWWINDOW( FINDWINDOW( 0, "TUTOR01" ), 9 )
SETFOREGROUNDWINDOW( FINDWINDOW( 0, "TUTOR01" ) )
msginfo([EMG])
RETURN NIL
ENDIF

MsgInfo( FWVERSION + Chr( 13 ) + FWCOPYRIGHT, FWDESCRIPTION )

return nil

//----------------------------------------------------------------------------//

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: isexerunning
Posted: Sun May 06, 2012 05:27 PM
Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

IF ISEXERUNNING( CFILENOEXT( HB_ARGV( 0 ) ) )
SHOWWINDOW( FINDWINDOW( 0, "FiveWin for xHarbour" ), 9 )
SETFOREGROUNDWINDOW( FINDWINDOW( 0, "FiveWin for xHarbour" ) )
RETURN NIL
ENDIF

MsgInfo( FWVERSION + Chr( 13 ) + FWCOPYRIGHT, FWDESCRIPTION )

return nil


EMG
Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: isexerunning
Posted: Sun May 06, 2012 06:04 PM

Enrico, all, solved!!

I use database fields to make the title of the main window, like a->field1+a->field2, perhaps it has spaces in the field, not finding the window title, after use a constant as name of the main window, it worked.
I think that all solutions posted work, the error was in the way I was building the title of the main window
This case shows that using a small example as tutor01 help isolate the problem and solve it.

thank to all, for your time.

BTW : taking advantage of the patience and goodwill of all, someone is getting build harbour from cvs? I get an error Unicows.dll.

best regards

:D

Continue the discussion