close EXCEL.EXE
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
close EXCEL.EXE
Hi Everybody,
Is there a way from within FWH to close Ms-Excel (EXCEL.EXE) if it is running in the background?
Thanks,
Jeff
Is there a way from within FWH to close Ms-Excel (EXCEL.EXE) if it is running in the background?
Thanks,
Jeff
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: close EXCEL.EXE
This is a working sample:
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
IF CLOSEEXCEL()
? "Excel closed"
ENDIF
RETURN NIL
#define GW_HWNDNEXT 2
#define GW_CHILD 5
STATIC FUNCTION CLOSEEXCEL()
LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD )
WHILE hWnd != 0
IF GETWINDOWTEXT( hWnd ) = "Microsoft Excel"
POSTMESSAGE( hWnd, WM_CLOSE )
RETURN .T.
ENDIF
hWnd = GETWINDOW( hWnd, GW_HWNDNEXT )
ENDDO
RETURN .F.
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Hi Enrico,
Once again I thank you.
It is people like you that make me glad I picked FWH as my programming language. Your knowledgeable and quick replies not only help solve our issues but also help expand our understanding of FWH.
I wish we had 10 of you ... but the one we do have is pretty dam good.
Thanks again for all you help.
Jeff
Once again I thank you.
It is people like you that make me glad I picked FWH as my programming language. Your knowledgeable and quick replies not only help solve our issues but also help expand our understanding of FWH.
I wish we had 10 of you ... but the one we do have is pretty dam good.
Thanks again for all you help.
Jeff
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- jose_murugosa
- Posts: 943
- Joined: Mon Feb 06, 2006 4:28 pm
- Location: Uruguay
- Contact:
Enrico, what is correct.EnricoMaria wrote:FWH is not a programming language but "merely" a library.Jeff Barnes wrote:[...]FWH as my programming language.
EMG
When I worked with Clipper I use to say I was a Clipper Programmer, and that Clipper was my "language".
Now If somebody ask me which language I use ¿Which is the right answer? c++? [x]Harbour FWH or .......?
Thanks for your help and support
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
José Murugosa
FWH + Harbour + Bcc7. Una seda!
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
xHarbour is better than FWH but xHarbour is a compiler not a language. Clipper is also a compiler. dBase III is an interpreter. I don't know if our beloved programming language has really a name. What do you think about "xBase language"?jose_murugosa wrote:Enrico, what is correct.
When I worked with Clipper I use to say I was a Clipper Programmer, and that Clipper was my "language".
Now If somebody ask me which language I use ¿Which is the right answer? c++? [x]Harbour FWH or .......?
EMG
- jose_murugosa
- Posts: 943
- Joined: Mon Feb 06, 2006 4:28 pm
- Location: Uruguay
- Contact:
Ok, I like it, thanks, Have a nice weekend.EnricoMaria wrote:xHarbour is better than FWH but xHarbour is a compiler not a language. Clipper is also a compiler. dBase III is an interpreter. I don't know if our beloved programming language has really a name. What do you think about "xBase language"?jose_murugosa wrote:Enrico, what is correct.
When I worked with Clipper I use to say I was a Clipper Programmer, and that Clipper was my "language".
Now If somebody ask me which language I use ¿Which is the right answer? c++? [x]Harbour FWH or .......?
EMG
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
José Murugosa
FWH + Harbour + Bcc7. Una seda!
Hi ! Enrico.
Clipper is my language when I was Born
Thank's Enrico for some help for me.
You are the good guy in the world
How to focus my window application
Best Regard
Areang
Clipper is my language when I was Born
Thank's Enrico for some help for me.
You are the good guy in the world
How to focus my window application
Code: Select all
IF GETWINDOWTEXT( hWnd ) = "My Application"
//POSTMESSAGE( hWnd, WM_CLOSE )
POSTMESSAGE(hWnd,????????) <---
RETURN .T.
ENDIF
Areang
Me too.
try this:
Best Regard
Areang[/quote]
try this:
Code: Select all
SetActiveWindow(hWnd)
[code]
[quote="areang"]Hi ! Enrico.
Clipper is my language when I was Born
Thank's Enrico for some help for me.
You are the good guy in the world :shock:
How to focus my window application
[code]
IF GETWINDOWTEXT( hWnd ) = "My Application"
//POSTMESSAGE( hWnd, WM_CLOSE )
POSTMESSAGE(hWnd,????????) <---
RETURN .T.
ENDIF
Areang[/quote]
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Or
EMG
Code: Select all
BringWindowToTop( hWnd )
Hi All !
This is work sample :
for setfocus and maximize windows to the top
Please reply !
regards
areang
This is work sample :
for setfocus and maximize windows to the top
Code: Select all
#include "Fivewin.ch"
#define SW_NORMAL 1
#define SW_MAXIMIZE 3
#define SW_MINIMIZE 6
#define SW_RESTORE 9
FUNCTION MAIN()
IF CLOSEEXCEL()
? "My Application ready for you"
ENDIF
RETURN NIL
#define GW_HWNDNEXT 2
#define GW_CHILD 5
STATIC FUNCTION CLOSEEXCEL()
LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD )
WHILE hWnd != 0
IF GETWINDOWTEXT( hWnd ) = "My Applicationl"
// POSTMESSAGE( hWnd, WM_CLOSE ) <-- work for close windows
// BringWindowToTop( hWnd ) <-- not work
SetActiveWindow( hWnd )
ShowWindow( hWnd, SW_MAXIMIZE )
RETURN .T.
ENDIF
hWnd = GETWINDOW( hWnd, GW_HWNDNEXT )
ENDDO
RETURN .F.
regards
areang