isexerunning (Solved)

Re: isexerunning

Postby Enrico Maria Giordano » Sun May 06, 2012 3:52 pm

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

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

Re: isexerunning

Postby norberto » Sun May 06, 2012 4: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

//----------------------------------------------------------------------------//
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR

Re: isexerunning

Postby Enrico Maria Giordano » Sun May 06, 2012 5:27 pm

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: isexerunning

Postby norberto » Sun May 06, 2012 6: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
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

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