Introducing QuirkSys Monitor Version 3.0 – My First Public Program Release
I’m excited to share QuirkSys Monitor Version 3.0, the first program I’m releasing publicly. This project is my return to coding and development, driven by my passion for creating tools that solve real problems.
Starting with a simple system resource monitor, this version has undergone multiple revisions, each adding features and functionality that I’ve wanted to implement over time. From a Pin on Top button to patching bugs discovered during initial use, this software is the result of hours of refining and improving based on my own needs and feedback.
This is just the beginning. QuirkSys Monitor is my first proof of concept, and I’m excited to keep developing more tools as new ideas come to me and as I find the time to build them. As I grow as a developer, I plan to release more programs that showcase my creativity and problem-solving skills.
You can find the screenshots and Source Code below this article and/or to the right side of the page. Feel free to check it out, and I hope you enjoy using it!
Source Code:
//System Resource Monitor
//Developed by: Nicholas Quirk
//Written in: C#
using System;
using System.Management;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
//Setting counters
PerformanceCounter cpuCounter;
PerformanceCounter ramCounter;
PerformanceCounter ramCounterTotal; //debugging RAM issue
public Form1()
{
InitializeComponent();
//Changing the window title
this.Text = "QuirkSys Monitor";
//Assigning performance counters
cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
ramCounter = new PerformanceCounter("Memory", "Available MBytes");
ramCounterTotal = new PerformanceCounter("Memory", "Committed Bytes");
// Prime the CPU counter
cpuCounter.NextValue();
}
private void Form1_Load(object sender, EventArgs e)
{
//Start the application timer
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
float cpuUsage = cpuCounter.NextValue();
float availableRAM_MB = ramCounter.NextValue(); // in MB
float committedRAM_Bytes = ramCounterTotal.NextValue();
//Convert committed RAM from bytes to MB
float committedRAM_MB = committedRAM_Bytes / (1024f * 1024f);
float totalRAM_Bytes = GetTotalPhysicalMemory(); // in bytes
float totalRAM_MB = totalRAM_Bytes / (1024f * 1024f); //Converts bytes to MB
float usedRAM_MB = totalRAM_MB - availableRAM_MB; //Calculate used RAM as total available
//Convert to GB
float usedRAM_GB = usedRAM_MB / 1024f;
float totalRAM_GB = totalRAM_MB / 1024f;
float pageFileUsage_MB = GetPageFileUsage();
float pageFileUsage_GB = pageFileUsage_MB / 1024f;
//debugging line to check if the timer tick event is firing
//MessageBox.Show("Timer ticked! Updating values.");
lblCPU.Text = $"🖥️ CPU Usage: {cpuUsage:F1}%";
lblRAM.Text = $"🧠 RAM Used: {usedRAM_GB:F2} GB / {totalRAM_GB:F2} GB";
lblSwap.Text = $"💽 PageFile/Swap Used: {pageFileUsage_GB:F2} GB";
}
private float GetTotalPhysicalMemory()
{
float total = 0;
var searcher = new ManagementObjectSearcher("SELECT TotalPhysicalMemory FROM Win32_ComputerSystem");
foreach (ManagementObject obj in searcher.Get())
{
total = Convert.ToSingle(obj["TotalPhysicalMemory"]);
}
return total;
}
private float GetPageFileUsage()
{
float usage = 0;
var searcher = new ManagementObjectSearcher("SELECT CurrentUsage FROM Win32_PageFileUsage");
foreach (ManagementObject obj in searcher.Get())
{
usage += Convert.ToSingle(obj["CurrentUsage"]);
}
return usage; // in MB
}
private void lblCPU_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
//
}
private void btnPinOnTop_Click(object sender, EventArgs e)
{
this.TopMost = !this.TopMost;
btnPinOnTop.Text = this.TopMost ? "Unpin" : "Pin on Top";
}
}
}