Desktop Functions: Smart Device Functions:
|
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
static extern uint GetCurrentProcessId();
Declare Function GetCurrentProcessId Lib "kernel32" () As Integer
public static extern uint GetCurrentProcessId();
uint MyID = FindMyself.GetCurrentProcessId();
Process.GetCurrentProcess().Id 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 10: Module32First
int procIDDDDDDDDDDDDD = Process.GetCurrentProcess().Id; 11: Module32Next
int procIDDDDDDDDDDDDD = Process.GetCurrentProcess().Id; int sessionId = System.Diagnostics.Process.GetCurrentProcess().SessionId; 13: SetPriorityClass
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) 16: VirtualQuery
int result = VirtualQueryEx(System.Diagnostics.Process.GetCurrentProcess().Handle, (IntPtr)address, out m, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION))); 17: VirtualQueryEx
int result = VirtualQueryEx(System.Diagnostics.Process.GetCurrentProcess().Handle, (IntPtr)address, out m, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION))); coredll18: TerminateProcess 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) 20: CreateWindowEx
IntPtr hInstance = Process.GetCurrentProcess().Handle; 21: GetGuiResources
return GetGuiResources(Process.GetCurrentProcess().Handle, 0);
return GetGuiResources(Process.GetCurrentProcess().Handle, 1); 22: IsIconic
Process[] p = Process.GetProcessesByName( Process.GetCurrentProcess().ProcessName , Environment.MachineName );
Process thisProcess = Process.GetCurrentProcess(); 23: SetWindowsHookEx
using (Process process = Process.GetCurrentProcess()) 24: SetWindowText SetWindowText(Process.GetCurrentProcess().MainWindowHandle, "Amazing!"); 25: ShowWindow
IntPtr handle = Process.GetCurrentProcess( ).MainWindowHandle; 26: ShowWindowAsync
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); ole32Constants
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 ); psapi32: EmptyWorkingSet
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 |