Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH to close specific windows by window title?
Message
From
04/08/2000 08:51:37
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00400866
Message ID:
00400957
Views:
11
>>>How would I close specific windows using WSH? The window title is a given.
>>
>>You could use the Wscript.Shell's AppActivate method to bring it to foreground, and then use the SendKeys method to send it an {alt-F4}; it assumes that the target accepts that. Better to use Sendmessage to issue a WM_QUIT to the application's main hWnd.
>
>Ed,
>I tried sending a window the WM_QUIT message but nothing happened. I then tried sending it the WM_CLOSE message and it terminated. What is the window supposed to do when it receives the Quit message?

WM_QUIT should tell the App to shut down, as opposed to WM_CLOSE, which tells the Window to close. Closing the top-level Window of an SDI app through WM_CLOSE should shut it down; WM_CLOSE to an MDI app shuts down the Window, but can leave other top-levels running.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform