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 "GetCurrentProcess" in [All]

kernel32

.

        Dim proc As Process = Process.GetCurrentProcess()

.

        return GetParentProcess(Process.GetCurrentProcess().Id);

.

public static extern int GetCurrentProcessorNumber();

.

Declare Function GetCurrentProcessorNumber Lib "kernel32.dll" (TODO) As TODO

.
Documentation
[GetCurrentProcessorNumber] on MSDN
.
Summary
.

static extern uint GetCurrentProcessId();

.

  Declare Function GetCurrentProcessId Lib "kernel32" () As Integer

.

    public static extern uint GetCurrentProcessId();

.

      uint MyID = FindMyself.GetCurrentProcessId();

.

Process.GetCurrentProcess().Id

.
Documentation
[GetCurrentProcessId] on MSDN
.

Another way: Process.GetCurrentProcess().MainModule.FileName

.

GetProcessHandleCount(Process.GetCurrentProcess().Handle, ref handles);

.

        if (GetProcessIoCounters(Process.GetCurrentProcess().Handle, out info) == false)

.

public static extern IntPtr GetCurrentProcess();

.

  AssignProcessToJobObject(Job, GetCurrentProcess());

.

  IsProcessInJob (GetCurrentProcess (), Job, out Is);

.

  IsProcessInJob (GetCurrentProcess (), IntPtr.Zero, out Is);

.

There is no need to call CloseProcess or to use a SafeHandle if you get the handle using GetCurrentProcess as it returns a pseudohandle.

.

     SafeProcessHandle processHandle = GetProcessHandle((uint)System.Diagnostics.Process.GetCurrentProcess().Id);

.

    'Dim processHandle As Long = GetProcessHandle(System.Diagnostics.Process.GetCurrentProcess().Id)

.

    If IsWow64Process(GetCurrentProcess(), retVal) Then

.

    int procIDDDDDDDDDDDDD = Process.GetCurrentProcess().Id;

.

    int procIDDDDDDDDDDDDD = Process.GetCurrentProcess().Id;

.

int sessionId = System.Diagnostics.Process.GetCurrentProcess().SessionId;

.

  SetPriorityClass(Process.GetCurrentProcess.Handle, PriorityClass.PROCESS_MODE_BACKGROUND_BEGIN)

.

IntPtr handle = Process.GetCurrentProcess().Handle;

.

                SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1) ;

.

            SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1)

.

     int result = VirtualQueryEx(System.Diagnostics.Process.GetCurrentProcess().Handle, (IntPtr)address, out m, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)));

.

    int result = VirtualQueryEx(System.Diagnostics.Process.GetCurrentProcess().Handle, (IntPtr)address, out m, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)));

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);

user32

.

AllowSetForegroundWindow(System.Diagnostics.Process.GetCurrentProcess().Id)

.

            IntPtr hInstance = Process.GetCurrentProcess().Handle;

.

        return GetGuiResources(Process.GetCurrentProcess().Handle, 0);

.

        return GetGuiResources(Process.GetCurrentProcess().Handle, 1);

.

            Process[] p = Process.GetProcessesByName( Process.GetCurrentProcess().ProcessName , Environment.MachineName );

.

      Process thisProcess = Process.GetCurrentProcess();

.

using (Process process = Process.GetCurrentProcess())

.

SetWindowText(Process.GetCurrentProcess().MainWindowHandle, "Amazing!");

.

IntPtr handle = Process.GetCurrentProcess( ).MainWindowHandle;

.

IntPtr handle = Process.GetCurrentProcess( ).MainWindowHandle;

.

        Process   procCurrent = Process.GetCurrentProcess();

ntdll

.

        IntPtr hProc = OpenProcess(0x001F0FFF, false, Process.GetCurrentProcess().Id);

.

        IntPtr hProc = OpenProcess((ProcessAccessFlags)0x001F0FFF, false, Process.GetCurrentProcess().Id);

ole32

Constants

.

            IntPtr pId = (Process.GetCurrentProcess().Handle);

dbghelp

.

static extern IntPtr GetCurrentProcess();

.

static extern uint GetCurrentProcessId();

.

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

psapi

.

            Dim Proc As Process = Process.GetCurrentProcess()

.

            Call EmptyWorkingSet(Process.GetCurrentProcess().Handle)

.

   private static extern IntPtr GetCurrentProcess();

.

   IntPtr currentProcessHandle = GetCurrentProcess();

advapi32

.

    internal static extern IntPtr GetCurrentProcess();

.

        IntPtr hproc = GetCurrentProcess();

.

          var currentProcess = NativeMethods.GetCurrentProcess();

.

      internal static extern IntPtr GetCurrentProcess();

.

        Dim hProc As IntPtr = Process.GetCurrentProcess().Handle


 
Access PInvoke.net directly from VS: