There are 4 flags that are described usually in articles/examples:
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}
Can I use any of them: http://msdn.microsoft.com/en-us/library/ms684863(v=VS.85).aspx / http://msdn.microsoft.com/en-us/library/ms683211(v=VS.85).aspx in that function?
What is the difference between those 2 links?
Why do I get an error in a CreateProcess function: Incompatible types: ‘Cardinal’ and ‘TThreadPriority’ if I have and do:
var Priority : Cardinal
Priority:=NORMAL_PRIORITY_CLASS;
CreateProcess(PChar(Path), Pchar(Par), nil, nil, false,
Priority, nil, nil, StartUpInfo, ProcessInfo);
What TThreadPriority….
Thanks!
You can use one of the 6 flags that the documentation of
GetPriorityClassfunction mentions. The reason RTL omits 2 of the flags is that they are not supported on Windows 9x/ME (this is in D2007, maybe later versions have those flags).You can
orthe priority class flag with any combination of process creation flags (except noted in the documentation – the first link you’ve provided).TThreadPriorityis an enumerated type used inTThreadin ‘classes.pas’ and is not related in anyway with process creation flags. The code posted in the question does not seem to have any problem (see comments to the question).