Bring another APP to top

Bring another APP to top

Postby sambomb » Mon Mar 14, 2011 2:19 pm

Hi, how can I bring another APP to top?

I developed an app to kill the task of my main project before start the compilation process, but the focus of the APP don't back for the compilation.

PS.: I Don't have the WindowText of this other APP so I can't use this code bellow

Code: Select all  Expand view

   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"

 
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Bring another APP to top

Postby sambomb » Thu Mar 17, 2011 11:29 am

Nobody?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Bring another APP to top

Postby James Bott » Thu Mar 17, 2011 12:48 pm

I am not sure I understand what you are trying to do, but maybe this is what you need. Save the foreground window then later set it to the foregroundWindow again using setForegroundWindow().

LOCAL hWnd := GETFOREGROUNDWINDOW()

DLL32 FUNCTION GETFOREGROUNDWINDOW() AS LONG;
PASCAL FROM "GetForegroundWindow" LIB "user32.dll"

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests