Total thread priority is a sum of local thread priority and class priority of current process. Use SetPriorityClass function and Priority property of TThread type to set priority parameters. Use GetPriorityClass function and Priority property of TThread type to get information about total thread priority.
type TTestThread = class(TThread) private j: Integer; { Private declarations } protected procedure GetInfo; procedure Execute; override; end; ... // Set priority procedure TForm1.Button1Click(Sender: TObject); var NewThread: TTestThread; begin NewThread:=TTestThread.Create(False); case RadioGroup2.ItemIndex of 0: NewThread.Priority:=tpIdle; 1: NewThread.Priority:=tpLowest; 2: NewThread.Priority:=tpNormal; 3: NewThread.Priority:=tpHighest; 4: NewThread.Priority:=tpTimeCritical; end; case Form1.RadioGroup1.ItemIndex of 0: SetPriorityClass(GetCurrentProcess, IDLE_PRIORITY_CLASS); 1: SetPriorityClass(GetCurrentProcess, NORMAL_PRIORITY_CLASS); 2: SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS); 3: SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS); end; end; // Get priority procedure TTestThread.GetPriority; var TotalStr: string; begin TotalStr:='Total Priority = '; case Priority of tpIdle: TotalStr:=TotalStr+'Idle'; tpLowest: TotalStr:=TotalStr+'Lowest'; tpNormal: TotalStr:=TotalStr+'Normal'; tpHighest: TotalStr:=TotalStr+'Highest'; tpTimeCritical: TotalStr:=TotalStr+'Time critical'; end; TotalStr:=TotalStr+' (local thread) + '; case GetPriorityClass(GetCurrentProcess) of IDLE_PRIORITY_CLASS: TotalStr:=TotalStr+'Idle'; NORMAL_PRIORITY_CLASS: TotalStr:=TotalStr+'Normal'; HIGH_PRIORITY_CLASS: TotalStr:=TotalStr+'High'; REALTIME_PRIORITY_CLASS: TotalStr:=TotalStr+'Realtime'; end; TotalStr:=TotalStr+' (class priority)'; Form1.Label1.Caption:=TotalStr; end;