by Jake (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 24th May 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Change the priority of available windows to idle or high
API Declarations
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Private Const NORMAL_PRIORITY_CLASS = &H20
Private Const IDLE_PRIORITY_CLASS = &H40
Private Const HIGH_PRIORITY_CLASS = &H80
private we as long,proc as long
GetWindowThreadProcessId(Me.hwnd, we)
'Get process handle of your window
proc = OpenProcess(0, False, we)
'Set the priority class of the window
SetPriorityClass proc, HIGH_PRIORITY_CLASS