Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What Am I Missing?
Message
De
27/06/2001 05:02:13
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
27/06/2001 01:03:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00523986
Message ID:
00524009
Vues:
21
This message has been marked as the solution to the initial question of the thread.
>Hi All:
>
>I'm trying to close a window/program using Windows API.
>I've done the following but to no avail.
>Could I be missing something here, or, am I just using
>the wrong APIs.
>
>LOCAL lcApplication, lnWndHnd
>
>*--Get the Window/Program HANDLE
>DECLARE INTEGER FindWindow IN Win32API;
>STRING @lpClassName, ;
>STRING @lpWindowName
>
>lcApplication = "MyProg"
>nWndHnd = FindWindow(0, @lcApplicationTitle)
>
>*--Close the Window/Program using the nWndHnd obtianed.
>DECLARE SHORT CloseHandle IN WIN32API;
>INTEGER hHandle
>
>=CloseHandle(nWinHnd)
>
>nWndHdn is numeric using FindWindow (if the program is running,
>otherwise nWndHnd = 0).
>
>However, ClsoeHandle does nothing (not even an error message).
>
>Would be greatful is someone can point out what/where I going
>wrong.
>
>TIA
>
>Mal

Mal,
I think you should use SendMessage instead :
SendMessage(lnHwnd, WM_CLOSE,0,0)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform