Window in the foreground

Post Reply
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Window in the foreground

Post by Natter »

Hi,

Is it possible to get the FW application exit event to the foreground ?
User avatar
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: Window in the foreground

Post by Antonio Linares »

This way you put a window foreground

SetForeGroundWindow( oWnd:hWnd )

Next, do you want to close it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Window in the foreground

Post by Natter »

I don't need to bring the application to the foreground. I just wanted to know if my app is in the foreground or not ?
User avatar
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: Window in the foreground

Post by Antonio Linares »

Code: Select all | Expand

if GetForeGroundWindow() == oWndMain:hWnd
   MsgInfo( "you app is in foreground" )
endif

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Window in the foreground

Post by Natter »

Thank you, Antonio!

Is it possible to intercept the moment when the window is in the foreground ? For example, my application is in the background. In the foreground is some other application. I am closing this application. As a result, my application comes to the fore. This is the moment I need to catch
User avatar
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: Window in the foreground

Post by Antonio Linares »

It seems as EVENT_SYSTEM_FOREGROUND is the event to check

Lets look for some examples...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Window in the foreground

Post by Natter »

I'll try using EVENT_SYSTEM_FOREGROUND. Or I'll just check GetForegroundWindow() == oWndMain:hWnd in the timer
Post Reply