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
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