How to bring app to top if already running?

Post Reply
User avatar
Ariston (BR)
Posts: 9
Joined: Fri May 07, 2010 1:42 am
Location: Macapá - Amapá - Brasil
Contact:

How to bring app to top if already running?

Post by Ariston (BR) »

HI. (Oi)

How can I have the app brounght to top if a try tu run it agian. (Como faço para trazer o aplicativo para a frente se eu tentar executá-lo novamente?)

Ariston Santos.
FWPPC
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: How to bring app to top if already running?

Post by Maurizio »

Code: Select all

CFILENAME := "test.exe"
  IF ISEXERUNNING( CFILENAME( HB_ARGV( 0 ) ) )
     msginfo("Test is running","Attenzione")
     SHOWWINDOW( FINDWINDOW( 0, "TEST" ), 9 )
     SETFOREGROUNDWINDOW( FINDWINDOW( 0, "TEST" ) )

     RETURN NIL
  ENDIF

  DEFINE WINDOW m->oWnd TITLE "TEST"

 
Regards Maurizio
Maurizio
User avatar
Ariston (BR)
Posts: 9
Joined: Fri May 07, 2010 1:42 am
Location: Macapá - Amapá - Brasil
Contact:

Re: How to bring app to top if already running?

Post by Ariston (BR) »

Thank you very much, friend. I'm gonna test it now.
Muito obrigado, amigo. Vou testar agora.

Editado (Edited)

It worked. Thanks again. (Funcionou. Obrigado novamente.)
Ariston Santos (Macapá-Amapá-Brasil)
FWPPC, Fwh26, xHb, xDev, WorkShop, Php, MySQL.
Post Reply