Desktop Functions: Smart Device Functions:
|
Search Results for "GetCurrentProcessId" in [All]dbghelp
static extern uint GetCurrentProcessId();
MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), file.SafeFileHandle.DangerousGetHandle(), MiniDumpWithFullMemory, ref info, IntPtr.Zero, IntPtr.Zero ); coredllObviously, 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#.
/* GetCurrentProcessId() and constants translated from kfuncs.h (SmartPhone2003) to C# */
IntPtr GetCurrentProcessId()
TerminateProcess(GetCurrentProcessId(), (IntPtr)0); kernel32 |