Desktop Functions: Smart Device Functions:
|
TerminateProcess (coredll)
coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for TerminateProcess in other DLLs exists, click on Find References to the right. Summary:This function terminates the specified process and all of its threads. (From MSDN.) C# Signature:
[DllImport("CoreDll.dll", SetLastError=true)] VB Signature:
Declare Function TerminateProcess Lib "coredll.dll" (ByVal processIdOrHandle As IntPtr, ByVal exitCode As IntPtr) As Integer User-Defined Types:None. Alternative Managed API:Do you know one? Please contribute it! Notes:None. Tips & Tricks:Obviously, you need a Process ID to kill. If you want to kill yourself (kill the current process), you'll need GetCurrentProcessId, but as GetCurrentProcessId() is an *inline* function defined in kfuncs.h in Microsoft's "Windows CE Tools" SDK, you can't call it with PInvoke. Use OpenNETCF's implementation, or read the function's inline definition from kfuncs.h and reimplement it in C#. Sample Code:
/* GetCurrentProcessId() and constants translated from kfuncs.h (SmartPhone2003) to C# */ Please add some! Documentation:Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|