Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

How to determine the track of the current CD


Here's an easy way to do it: create a timer and put this code in the OnTimer event:

  Trk, Min, Sec: Word;
  with MediaPlayer1 do
    Trk := MCI_TMSF_TRACK(Position);
    Min := MCI_TMSF_MINUTE(Position);
    Sec := MCI_TMSF_SECOND(Position);
    Label1.Caption := Format('%.2d', [Trk]);
    Label2.Caption := Format('%.2d:%.2d', [Min,Sec]);

Add MMSystem to the uses clause of the unit. The code will show the current track and time.

Original resource: The Delphi Pool
Author: Unknown
Added: 2009-11-06
Last updated: 2009-11-06

« Return to contents »