Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH to close specific windows by window title?
Message
 
 
To
04/08/2000 00:28:32
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00400866
Message ID:
00400919
Views:
14
>How would I close specific windows using WSH? The window title is a given.

AFAIK, the WSH doesn't provide a COM wrapper for this functionality. You have to use the WinAPI directly. Erik Moore has a write up on how to do this in the API section. Here is an example (paraphrased):
#DEFINE WM_CLOSE 0x10
declare integer FindWindow in "user32" string lpclass, string lptitle
declare integer SendMessageA in "user32" as "SendMessage" integer hwnd, integer wMsg, integer wParam, integer lParam

lnwnd = FindWindow(.NULL.,MyWindowTitleHere)

if lnwnd > 0 then
	=SendMessage(lnwnd,WM_CLOSE, 0, 0)
else
	wait 'Unable to find window' window
endif
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform