Window in the foreground

Window in the foreground

Postby Natter » Thu Sep 15, 2022 7:06 am

Hi,

Is it possible to get the FW application exit event to the foreground ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Window in the foreground

Postby Antonio Linares » Thu Sep 15, 2022 7:01 pm

This way you put a window foreground

SetForeGroundWindow( oWnd:hWnd )

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

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

Re: Window in the foreground

Postby Natter » Thu Sep 15, 2022 7:08 pm

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

Re: Window in the foreground

Postby Antonio Linares » Thu Sep 15, 2022 7:26 pm

Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Window in the foreground

Postby Natter » Thu Sep 15, 2022 8:21 pm

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

Re: Window in the foreground

Postby Antonio Linares » Thu Sep 15, 2022 8:28 pm

It seems as EVENT_SYSTEM_FOREGROUND is the event to check

Lets look for some examples...
regards, saludos

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


Re: Window in the foreground

Postby Natter » Fri Sep 16, 2022 8:41 am

I'll try using EVENT_SYSTEM_FOREGROUND. Or I'll just check GetForegroundWindow() == oWndMain:hWnd in the timer
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 62 guests