Hi I have a working media player that references the imported winmm.dll. I am trying to link a trackbar to the dll to find the file length & seek to the scrolled related timeframe. I have the code now that only starts the trackbar when the play button starts. Any help would be awsome! Thanks,
Jamesonh20
using System.Runtime.InteropServices;
using System.IO;
//Import DLL
[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand, StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);
private void trackBar1_Scroll(object sender, EventArgs e)
{
//Converts trackbar value to label
string trackerbar = Convert.ToString(scrollTimer.Interval);
label2.Text = trackBar1.Value.ToString();
}
private void scrollTimer_Tick_1(object sender, EventArgs e)
{
if (trackBar1.Value < trackBar1.Maximum)
{
label2.Text = trackBar1.Value.ToString();
trackBar1.Value += 1;
}
else
{
trackBar1.Value = 0;
scrollTimer.Enabled = false;
}
}