Hi Everybody,
Is there a way from within FWH to close Ms-Excel (EXCEL.EXE) if it is running in the background?
Thanks,
Jeff
#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 wrote:[...]FWH as my programming language.
EnricoMaria wrote:Jeff Barnes wrote:[...]FWH as my programming language.
FWH is not a programming language but "merely" a library.
EMG
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 .......?
EnricoMaria wrote: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 .......?
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"?
EMG
IF GETWINDOWTEXT( hWnd ) = "My Application"
//POSTMESSAGE( hWnd, WM_CLOSE )
POSTMESSAGE(hWnd,????????) <---
RETURN .T.
ENDIF
areang wrote: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
[code]
IF GETWINDOWTEXT( hWnd ) = "My Application"
//POSTMESSAGE( hWnd, WM_CLOSE )
POSTMESSAGE(hWnd,????????) <---
RETURN .T.
ENDIF
[/code]
Best Regard
Areang
#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.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 56 guests