VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Process Priority Changer

Brandon Kampschuur  (1 Submission)   Windows System Services   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This code is designed to change the priority of processes that are running on a windows machine. I had to write it for our company, which was having problems with Oracle processes taking over the server...this program was designed to change these processes to Low priority.

Assumes
You should be familiar with using the Win32 API functions to understand how the code works. Also, knowing about the listview and timer controls will help.

API Declarations
These are the API functions used:
Public Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Public Declare Function GetPriorityClass Lib "kernel32" (ByVal hProcess As Long) As Long
Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
Public Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Public Declare Function EnumProcesses Lib "psapi.dll" (ByRef lpidProcess As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long
Public Declare Function GetModuleFileNameExA Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal ModuleName As String, ByVal nSize As Long) As Long
Public Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long
Public Declare Function GetLastError Lib "kernel32" () As Long

Rate Process Priority Changer (7(7 Vote))

Download Process Priority Changer

Process Priority Changer Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters