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