Dear Michel,
If you don't call cWord:Quit() does Word remain opened ?
So you can only call cWord:Quit() if there no more FWH apps using it
is that correct ? thanks
Are you using Borland or MSVC32 ?
Dear Michel,
If you don't call cWord:Quit() does Word remain opened ?
So you can only call cWord:Quit() if there no more FWH apps using it
is that correct ? thanks
Are you using Borland or MSVC32 ?
That is correct.
I use Borland
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
STATIC PROCEDURE WordQuit
local nFWHApps := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) == "TWINDOW", nFWHApps++, ) } )
if nFWHApps == 1
cWord:Quit()
endif
RETURNAntonio,
If I understand well, this function is checking if another FWH-application is active.
This function is doing its job fantasticly.
But would it be difficult to create a same function for other applications or files (Word- or Excel-documents)?
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Dear Michel,
> would it be difficult to create a same function for other applications or files (Word- or Excel-documents)?
You simply apply the same logic:
if there is only one FWH app running then you can quit it, if not, you don't
Antonio,
But what if Word is started manually?
The document in that session can't be closed either.
How to prevent that?
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
STATIC PROCEDURE WordQuit
local nFWHApps := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) $ "TWINDOW,OpusApp", nFWHApps++, ) } )
if nFWHApps == 1
cWord:Quit()
endif
RETURNThanks a lot, Antonio.
I am away for the day and I will test it tonight.
Have a nice day.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Hello Antonio,
I did some testing.
The function returns 4 if a Word session is opened.
If a second Word session is opened, the function returns 6.
If no Word session is active, the function returns 3.
Weard, isn't it?
Any suggestion?
Thanks.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
STATIC PROCEDURE WordQuit
local nFWHApps := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) $ "TWINDOW,OpusApp", nFWHApps++, ) } )
if nFWHApps == 4
cWord:Quit()
endif
RETURNSTATIC PROCEDURE WordQuit
LOCAL nFWHApps1 := 0
LOCAL nFWHApps2 := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) == "TWINDOW" , nFWHApps1++, ) } )
EnumWindows( { | hWnd | If( GetClassName( hWnd ) $ "TWINDOW,OpusApp", nFWHApps2++, ) } )
IF nFWHApps1 < 2 .AND. nFWHApps2 < 3
cWord:Quit()
ENDIF
RETURNRegards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Antonio,
I can't use xHarbour Builder. EnumWinows() is unresolved, the message says.
What do i need to do to solve this problem?
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Dear Michel,
Already sent to your email
Thanks a lot, Antonio.
This function is now also accepted in xHarbour Builder.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773