Desktop Functions:

   Smart Device Functions:

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

CreateProcess (kernel32)

C# Signature:

     [DllImport("kernel32.dll", SetLastError=true)]
     static extern bool CreateProcess( String imageName,
        String cmdLine,
        IntPtr lpProcessAttributes,
        IntPtr lpThreadAttributes,
        bool boolInheritHandles,
        Int32 dwCreationFlags,
        IntPtr lpEnvironment,
        IntPtr lpszCurrentDir,
        byte [] si,
        ProcessInfo pi );

VB Signature:

Declare Function CreateProcess Lib "kernel32.dll" (ByVal imageName As String, ByVal cmdLine As String, ByVal lpProcessAttributes As IntPtr, ByVal lpThreadAttributes As IntPtr, ByVal boolInheritHandles As Int32, ByVal dwCreationFlags As Int32, ByVal lpEnvironment As IntPtr, ByVal lpszCurrentDir As IntPtr, ByVal si As Byte(), ByVal pi As ProcessInfo) As Integer

User-Defined Types:


     public class ProcessInfo
     public IntPtr hProcess;
     public IntPtr hThread;
     public Int32 ProcessId;
     public Int32 ThreadId;


     Public Class ProcessInfo
     Public hProcess As IntPtr
     Public hThread As IntPtr
     Public ProcessId As Int32
     Public ThreadId As Int32
     End Class

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Find References
Show Printable Version