Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
End a process in Win2K/WinXP
Message
From
07/10/2002 12:13:18
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00708380
Message ID:
00708402
Views:
12
>Hi Ed,
>While it's true that TerminateProcess is the hand grenade approach, it sounds like that may be what is needed. I would think that a WM_CLOSE/WM_QUIT would be passed along to the control when VFP receives it. From the explanation, it looks like that is being ignored.
>
>>>>I am using an ActiveX control in my program that doesn't terminate properly when released. It's not a VFP problem - the same thing happens using the control under VB6 using the vendor's own sample files. So far no help from them other than that they designed it this way. I CAN end it by going into Task Manager and ending the process. What I want to do is incorporate this in my program so that when my program ends it also kills this rogue task. Which API call should be used for this, and can it be used under VFP?
>>>>
>>>> Thanks,
>>>
>>>Randy,
>>>See Message#496824 for an example.
>>>
>>
>>TerminateProcess() is a pretty extreme measure; an ActiveX control should have it's own hWnd, in which case, I'd try sending a WM_CLOSE message to the hWnd of the ActiveX, and issuing a PostQuitMessage() to terminate the VFP session in an orderly fashion. You can also try sending a WM_QUIT to the ActiveX's hWnd.

In that case, I'd try to get the ThreadID of the ActiveX (if it runs on a different thread than VFP's actually using) and use TerminateThread(). I hate leaving unnecessary collateral damage around just to get my app to shut down!
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform