Closing another aplication

Closing another aplication

Postby Frank Demont » Wed Jul 26, 2006 9:53 am

Hello

In mine aplication , i use

Memowrit("C:\TEMP\efkes.rtf",cText)
Shellexecute(0 ,0 , "C:\TEMP\efkes.rtf" ,0 ,0 , 1)

To edit a rtf-file

When the rtf-file is not closed , and this commands are executed again with a different cText , the editor is activated with the old text file not the new

Using findwnd from enrico , i continue with :

? "Attention , Wordpad.exe or winword.exe must be closed correctly"

DO WHIL .T.
hWnd := FINDWND( "EFKES.RTF" )
IF !EMPTY( hWnd )
? "Temporary rtf-file is not closed : " + CRLF + GETWINDOWTEXT( hWnd )
ELSE
EXIT
END

But , knowing the handle from the editor , can it be closed by FW ?
In that case we don't need a looping

Frank
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Re: Closing another aplication

Postby Enrico Maria Giordano » Wed Jul 26, 2006 12:38 pm

If you mean the handle of the window then yes:

Code: Select all  Expand view
#define WM_CLOSE 16

SENDMESSAGE( hWnd, WM_CLOSE )

or

POSTMESSAGE( hWnd, WM_CLOSE )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Frank Demont » Wed Jul 26, 2006 2:57 pm

Enricio

thank you very much , as always it works

I hope i am not to late : congratulations to italy with welth cup !!!


Frank
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 109 guests