title: Delphi: Process Creation Flags in CreateProcess function
body: <p>There are 4 flags that are described usually in articles/examples:</p>
  
  <pre><code> NORMAL_PRIORITY_CLASS           = $00000020;
    {$EXTERNALSYM NORMAL_PRIORITY_CLASS}
    IDLE_PRIORITY_CLASS             = $00000040;
    {$EXTERNALSYM IDLE_PRIORITY_CLASS}
    HIGH_PRIORITY_CLASS             = $00000080;
    {$EXTERNALSYM HIGH_PRIORITY_CLASS}
    REALTIME_PRIORITY_CLASS         = $00000100;
    {$EXTERNALSYM REALTIME_PRIORITY_CLASS}
  </code></pre>
  
  <p>Can I use any of them: <a href="http://msdn.microsoft.com/en-us/library/ms684863(v=VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms684863(v=VS.85).aspx</a> / <a href="http://msdn.microsoft.com/en-us/library/ms683211(v=VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms683211(v=VS.85).aspx</a> in that function?</p>
  
  <p>What is the difference between those 2 links?</p>
  
  <p>Why do I get an error in a CreateProcess function: Incompatible types: 'Cardinal' and 'TThreadPriority' if I have and do:</p>
  
  <pre><code>var Priority : Cardinal
  Priority:=NORMAL_PRIORITY_CLASS;
  CreateProcess(PChar(Path), Pchar(Par), nil, nil, false,
  Priority, nil, nil, StartUpInfo, ProcessInfo);
  </code></pre>
  
  <p>What TThreadPriority....</p>
  
  <p>Thanks!</p>