>I am using the following to OPEN a document.
>How do i close the same document?
>
>tnx
>k
>
>
>#DEFINE SW_SHOWNORMAL 1
>lcUrl = "c:myfile.txt"
>oShell = Createobject("wscript.shell")
>oShell.Run(lcUrl)
>
>DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
>INTEGER hwnd, STRING lpVerb, STRING lpFile, ;
>STRING lpParameters, STRING lpDirectory, LONG nShowCmd
>ShellExecute(0, "Open", lcUrl, "", "", SW_SHOWNORMAL)
You'd need the process ID to kill it, or its hwnd to send it a close message, or something like that. There are, probably, ways to get those.
If you want to control the whole process, why not keep it in fox? Modify File "c:\myfile.txt" in macdesktop, store wontop() in a safe place, and when you want to close it, release window (lcWindowName). The "in macdesktop" is an old dirty trick which will open it as a top window form, outside of _screen.