KillProcess
This function terminates the specified process and all of its threads.
DWORD KillProcess(
   TCHAR *szName
);
Parameters
szName
[in] Pointer to the null-terminated string that contains the name of the process to kill. This cannot be NULL.

Return values
Zero indicates success. A negative error number indicates that an error occurred. For additional error information, enable the library debug mode.

Remarks
This function is used to unconditionally cause a process to exit.
Use this function only in extreme circumstances.
This function causes all threads within a process to terminate, causes a process to exit, and notifies each DLL that the process is terminating.
The following list shows what occurs when a process is terminated:
All object handles opened by the process are closed.
All threads in the process terminate their execution.
The state of the process object becomes signaled, satisfying threads waiting for the process to terminate.
The states of all threads of the process become signaled, satisfying threads waiting for the threads to terminate.
The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
Terminating a process does not necessarily remove the process object from the system.
A process object is deleted when the last handle to the process is closed.

Sample
// Application entry point
int WINAPI WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPTSTR lpCmdLine,
    int nCmdShow)
{
    // Load the TAPI Library
    if (LoadDynTapiDll(TEXT("\\DynTapiDll.dll")) != ERROR_SUCCESS) {
    MessageBox(0, TEXT("Cannot load DynTapiDll.dll . Try to reinstall this sample."), TEXT(""), MB_ICONERROR);
    return 0;
    }
    DebugMode(1);
    // Stop native phone application, so it would not interfeer with our application
    KillProcess(TEXT("cprog.exe"));
    // Init the Library network component
    if (NetworkInit(hInstance) != ERROR_SUCCESS) {
    UnloadDynTapiDll();
    MessageBox(0, TEXT("Error using the network, does this device have a phone module?"), TEXT(""), MB_ICONERROR);
    return 0;
    }
    // Set callback for events
    SetNetworkEventCallback((tpfnCallback)PhoneCallback);
    // Try dialing a number
    if (NetworkDialNumber(TEXT("555111222"))!=ERROR_SUCCESS) MessageBox(0,TEXT("Can't dial number"), TEXT(""),MB_ICONERROR);
    ...
    NetworkDeinit();
    UnloadDynTapiDll();
    ...

Requirements
OS Versions: Windows CE 1.0 and later.
Header: dyntapi.h.
Dll Library: dyntapidll.dll.

For the latest DynTAPI version, visit www.teksoftco.com.