Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I close a window
Message
From
29/12/2009 22:25:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
29/12/2009 19:21:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01441149
Message ID:
01441181
Views:
46
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform