Small Question about Word and FWH
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
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 ?
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 ?
Re: Small Question about Word and FWH
That is correct.
I use Borland
I use Borland
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
Dear Michel,
Please change your function this way:
I am emailing you a modified fivehc.lib
many thanks for your feedback
Please change your function this way:
Code: Select all | Expand
STATIC PROCEDURE WordQuit
local nFWHApps := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) == "TWINDOW", nFWHApps++, ) } )
if nFWHApps == 1
cWord:Quit()
endif
RETURN
many thanks for your feedback
Re: Small Question about Word and FWH
Antonio,
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)?
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
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
> 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
Re: Small Question about Word and FWH
Antonio,
But what if Word is started manually?
The document in that session can't be closed either.
How to prevent that?
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
Dear Michel,
Please use this code:
Please use this code:
Code: Select all | Expand
STATIC PROCEDURE WordQuit
local nFWHApps := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) $ "TWINDOW,OpusApp", nFWHApps++, ) } )
if nFWHApps == 1
cWord:Quit()
endif
RETURN
Re: Small Question about Word and FWH
Thanks a lot, Antonio.
I am away for the day and I will test it tonight.
Have a nice day.
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Re: Small Question about Word and FWH
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.
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
Dear Michel,
Please try it this way:
Please try it this way:
Code: Select all | Expand
STATIC PROCEDURE WordQuit
local nFWHApps := 0
EnumWindows( { | hWnd | If( GetClassName( hWnd ) $ "TWINDOW,OpusApp", nFWHApps++, ) } )
if nFWHApps == 4
cWord:Quit()
endif
RETURN
Re: Small Question about Word and FWH
Hello Antonio,
Thanks to all your efforts, I have made a combination of testing other FWH-applications and other Word-sessions.
This the code which seem to work (I need to do more tests):I do some more tests and I will let you know.
Thanks to all your efforts, I have made a combination of testing other FWH-applications and other Word-sessions.
This the code which seem to work (I need to do more tests):
Code: Select all | Expand
STATIC 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
RETURN
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
very good
Re: Small Question about Word and FWH
Antonio,
I can't use xHarbour Builder. EnumWinows() is unresolved, the message says.
What do i need to do to solve this problem?
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Antonio Linares
- Site Admin
- Posts: 42275
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Small Question about Word and FWH
Dear Michel,
Already sent to your email
Already sent to your email
Re: Small Question about Word and FWH
Thanks a lot, Antonio.
This function is now also accepted in xHarbour Builder.
This function is now also accepted in xHarbour Builder.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773