Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RUN command
Message
 
To
18/05/1998 08:53:06
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00099389
Message ID:
00100098
Views:
36
>George,
>
>BTW, is there an easy way to close this application I've launched with ShellExecute when my VFP application ends.
>
>Thanks
First, download the Is_Run program in the files section (in Win 32 and other APIs). Use the Is_Run32 function to retrieve the window handle of the open application. Simply pass the function the known portion of the title bar.

Then you need the following:
DECLARE INTEGER SendMessage IN Win32API;
  INTEGER hWnd, INTEGER uMsge, INTEGER wParm, INTEGER lParm
* Call Is_Run32 with the title (lctitle in this case)
lnhWnd = Is_Run32(lctitle)
* Close the application - 16 = WM_CLOSE
= SendMessage(lnhWnd, 16, 0, 0)
I also seem to recall that WM_QUERYENDSESSION also works, but it's a little more complex to use.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform