I’m trying to make a program in C# that monitors the processor time of an application. I’d like to have a feature in this program where the task-bar icon is actually a number representing the processor time (like what coretemp has). How would I go about doing something like this?
Share
You need to use the classes in the
System.Drawingnamespace.Create a
Bitmap, useGraphics.FromImageto draw on it, then callIcon.FromHandle(myBitmap.GetHicon()).You can then set the icon as your form’s
Iconproperty.EDIT: Like this:
You can run this in a timer to continually update the icon.
You can get the CPU usage like this: