FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Window moving into the background
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Window moving into the background
Posted: Thu Oct 20, 2016 12:56 PM

Hi all !

Can I handle the event of the window moving my tasks into the background ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Window moving into the background
Posted: Thu Oct 20, 2016 03:22 PM

Your FWH app will receive the events and process them even if it is in background

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Window moving into the background
Posted: Thu Oct 20, 2016 08:46 PM

I wanted to move my application on a second plan was carried out some actions

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Window moving into the background
Posted: Fri Oct 21, 2016 07:35 AM

Could you provide a small example to test here ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Window moving into the background
Posted: Fri Oct 21, 2016 10:36 AM

DEFINE WINDOW oWnd //main window

DEFINE TIMER oTm OF oWnd INTERVAL 15000 ACTION Chk_Grnd()
oTm:Activate()

procedure Chk_Grnd

if oWnd is background (I don't know how to define it)
.............
else
.............
endif
return

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Window moving into the background
Posted: Fri Oct 21, 2016 07:33 PM
> if oWnd is background (I don't know how to define it)

https://msdn.microsoft.com/es-es/library/windows/desktop/ms633505(v=vs.85).aspx

Code (fw): Select all Collapse
if GetForegroundWindow() != oWnd:hWnd

...

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( GETFOREGROUNDWINDOW )
{
   hb_retnll( GetForegroundWindow() );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Window moving into the background
Posted: Sat Oct 22, 2016 10:45 AM

Thank, Mr. Antonio. It's work fine !

Continue the discussion