Recent

Author Topic: Disk Access Monitor  (Read 2964 times)

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
Disk Access Monitor
« on: July 13, 2018, 06:34:02 pm »
I'm looking to build a little tool that shows disk I/O in Windows (or even cross-platform if possible).

I've found this page (https://code.msdn.microsoft.com/windowsapps/Disk-Activity-Task-bar-af8ae245) which describes using PerformanceCounters to do this, but I can't find an equivalent in Lazarus.

Thanks,

Dan

ASerge

  • Hero Member
  • *****
  • Posts: 2223
Re: Disk Access Monitor
« Reply #1 on: July 13, 2018, 09:37:09 pm »
...which describes using PerformanceCounters to do this, but I can't find an equivalent in Lazarus.
I don't know. Try to write yourself, using WinApi.

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
Re: Disk Access Monitor
« Reply #2 on: July 16, 2018, 06:38:42 pm »
Sorry, I should have been clearer in my question... I wasn't looking for equivalent sample code (I am planning to try writing equivalent sample code myself).

What I am looking for is an equivalent library for FPC/Lazarus that would allow me to access the Windows PerformanceCounters.

I guess from your reply that WinApi is the way to go, but I can't find any calls that seem equivalent to the ones used in the VB sample code, for example:

Code: Pascal  [Select][+][-]
  1. PerformanceCounterCategory.Exists("LogicalDisk")
  2. ReadCounter = New PerformanceCounter("LogicalDisk", "Disk Read Bytes/sec", "_Total")
  3. R = ReadCounter.NextValue

Sorry, my original question was pretty badly written.

-FM

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Disk Access Monitor
« Reply #3 on: July 16, 2018, 06:49:17 pm »
Try this https://tondrej.blogspot.com/2004/09/perfmon-ready.html
It is for Delphi but in mode delphi there is no reason it should not work. (D7 is 99.9% compatible )
« Last Edit: July 16, 2018, 07:17:32 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018