Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 914 Bytes

sample_173.md

File metadata and controls

38 lines (30 loc) · 914 Bytes

Home

Retrieving the priority class for the current process

Code:

DECLARE INTEGER GetCurrentProcess IN kernel32

DECLARE INTEGER GetPriorityClass IN kernel32;
	INTEGER hProcess

#DEFINE NORMAL_PRIORITY_CLASS     32
#DEFINE IDLE_PRIORITY_CLASS       64
#DEFINE HIGH_PRIORITY_CLASS      128
#DEFINE REALTIME_PRIORITY_CLASS  256

	lnPriority = GetPriorityClass(GetCurrentProcess())

	? "Priority class: "
	DO CASE
	CASE lnPriority = NORMAL_PRIORITY_CLASS
		?? "Normal"
	CASE lnPriority = IDLE_PRIORITY_CLASS
		?? "Idle"
	CASE lnPriority = HIGH_PRIORITY_CLASS
		?? "High"
	CASE lnPriority = REALTIME_PRIORITY_CLASS
		?? "Real Time"
	OTHER
		?? "Unknown"
	ENDCASE  

Listed functions:

GetCurrentProcess
GetPriorityClass