Window moving into the background

Window moving into the background

Postby Natter » Thu Oct 20, 2016 12:56 pm

Hi all !

Can I handle the event of the window moving my tasks into the background ?
Natter
 
Posts: 1144
Joined: Mon May 14, 2007 9:49 am

Re: Window moving into the background

Postby Antonio Linares » Thu Oct 20, 2016 3: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Window moving into the background

Postby Natter » Thu Oct 20, 2016 8:46 pm

I wanted to move my application on a second plan was carried out some actions
Natter
 
Posts: 1144
Joined: Mon May 14, 2007 9:49 am

Re: Window moving into the background

Postby Antonio Linares » Fri Oct 21, 2016 7:35 am

Could you provide a small example to test here ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Window moving into the background

Postby Natter » 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
Natter
 
Posts: 1144
Joined: Mon May 14, 2007 9:49 am

Re: Window moving into the background

Postby Antonio Linares » Fri Oct 21, 2016 7: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: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 41481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Window moving into the background

Postby Natter » Sat Oct 22, 2016 10:45 am

Thank, Mr. Antonio. It's work fine !
Natter
 
Posts: 1144
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

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