Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "GetCurrentProcessId" in [All]

dbghelp

.

static extern uint GetCurrentProcessId();

.

    MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), file.SafeFileHandle.DangerousGetHandle(), MiniDumpWithFullMemory, ref info, IntPtr.Zero, IntPtr.Zero );

coredll

.

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

.

/* GetCurrentProcessId() and constants translated from kfuncs.h (SmartPhone2003) to C# */

.

IntPtr GetCurrentProcessId()

.

    TerminateProcess(GetCurrentProcessId(), (IntPtr)0);

kernel32

.
Summary
.

static extern uint GetCurrentProcessId();

.

  Declare Function GetCurrentProcessId Lib "kernel32" () As Integer

.

    public static extern uint GetCurrentProcessId();

.

      uint MyID = FindMyself.GetCurrentProcessId();

.
Documentation
[GetCurrentProcessId] on MSDN

 
Access PInvoke.net directly from VS: