Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WSH to close specific windows by window title?
Message
 
 
À
04/08/2000 00:28:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00400866
Message ID:
00400919
Vues:
15
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform