Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing other windows Applications
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00134426
Message ID:
00134478
Vues:
9
Hi Don

>I use RUN /n7 DEMODATA.EXE to start my demodata application. I have two questions:
>1) How do I determine from my VFP 5.0 application that demodata.exe is actually running?

You could use my Is_Run function, available in the download section (filing cabinet icon) under Win32 and other APIs. Pass it the known portion of the title bar. If the title bar isn't dynamic you could use the FindWindow() API call.

>2) How do I terminate demodata.exe from my VFP application?

Try using the SendMessage API function. Both my Is_Run and the FindWindow return the window handle. This is one of the required parameters for SendMessage. Below are the declarations and samples of these two API calls.
DECLARE INTEGER FindWindow IN Win32API;
  STRING @lpClassName, STRING @lpWindowName
* lctitle is the title bar text
lnhWnd = FindWindow(0, @lctitle)
DECLARE INTEGER SendMessage IN Win32API;
  INTEGER hWnd, INTEGER uMsg, INTEGER wparm, INTEGER lparm
#define WM_CLOSE  0x0010
= SendMessage(lnhWnd, WM_CLOSE, 0, 0)
hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform