PROCESS_INFORMATION (Structures)
Last changed: -97.79.160.250

.
Summary
Used with CreateProcess, CreateProcessAsUser, and CreateProcessWithLogonW to specify the window station, desktop, standard handles, and appearance of the main window for the new process.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
public struct PROCESS_INFORMATION
{
   public IntPtr hProcess;
   public IntPtr hThread;
   public uint dwProcessId;
   public uint dwThreadId;
}

VB Definition:

Structure PROCESS_INFORMATION
   Public hProcess As IntPtr
   Public hThread As IntPtr
   Public dwProcessId As Integer
   Public dwThreadId As Integer
End Structure

Notes:

None.

Tips & Tricks:

Some APIs need an LPPROCESS_INFORMATION instead of just a PROCESS_INFORMATION. You can obtain that with code like the following:

PROCESS_INFORMATION procInfo = new PROCESS_INFORMATION();

GCHandle procInfoHandle = GCHandle.Alloc(procInfo, GCHandleType.Pinned);

try

{

    IntPtr lpProcInfo = procInfoHandle.AddrOfPinnedObject();
    // ... use the lpProcInfo as a LPPROCESS_INFORMATION ...

}

finally

{

    procInfoHandle.Free();

}

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
STARTUPINFO on MSDN