VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Process Priority Changer

by Brandon Kampschuur (1 Submission)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

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

Download Process Priority Changer

Download Process Priority Changer (7 KB)

Process Priority Changer Comments

No comments have been posted about Process Priority Changer. Why not be the first to post a comment about Process Priority Changer.

Post your comment

Subject:
Message:
0/1000 characters