hi,
i found this on the internet for winamp
private void mainThread()
{
int WinampWindow;
int WinampStatus;
int OldSongPosition;
int i;
MessengerAPI.MessengerClass MSN = new MessengerAPI.MessengerClass();
try
{
while (true)
{
WinampWindow = FindWindow("Winamp v1.x", null);
//if winamp is running
if (WinampWindow != 0)
{
//write playlist
SendMessage(WinampWindow, 1024, 0, WM_WRITEPLAYLIST);
//get winampstatus
WinampStatus = SendMessage(WinampWindow, WM_USER, 0, WM_GETSTATUS);
switch (WinampStatus)
{
case 1:
lblWinampState.Text = "Playing";
groupBox2.Visible = true;
break;
case 3:
lblWinampState.Text = "Paused";
groupBox2.Visible = true;
break;
default:
groupBox2.Visible = false;
lblWinampState.Text = "Stopped";
break;
}
//get old song position
OldSongPosition = CurrentSongPosition;
//get new song position
CurrentSongPosition = SendMessage(WinampWindow, 1024, 0, WM_PLAYLISTPOSITION);
//if new song isnt the old song (new track)
if (OldSongPosition != CurrentSongPosition)
{
StreamReader streamread = new StreamReader("C:\\Program Files\\Winamp\\Winamp.m3u");
string curLine;
i = 0;
while ((curLine = streamread.ReadLine()) != null)
{
//prevent line which start with # to be counted
if (curLine.StartsWith("#"))
continue;
//if we reached the current file
if (i == CurrentSongPosition)
{
//getting fileinfo of current song
FileInfo fileinfo = new FileInfo(curLine);
if (pictureBox1.Image != null)
pictureBox1.Image.Dispose();
//getting MP3 tags
MP3File mp3File = ShellID3TagReader.ReadID3Tags(curLine);
txtFilename.Text = curLine;
txtArtist.Text = mp3File.ArtistName;
txtAlbum.Text = mp3File.AlbumName;
txtTitle.Text = mp3File.SongTitle;
//if there is a folder.jpg in the directory of the current playing song
if (File.Exists(fileinfo.Directory + "\\folder.jpg"))
{
pictureBox1.Visible = true;
pictureBox1.Image = new Bitmap(Image.FromFile(fileinfo.Directory + "\\folder.jpg"), 100, 100);
//setting the folder.jpg as the MSN DP
MSN.set_MyProperty((MessengerAPI.MCONTACTPROPERTY)2, fileinfo.Directory + "\\folder.jpg");
}
else
pictureBox1.Visible = false;
break;
}
i++;
}
streamread.Close();
}
}
else
{
groupBox2.Visible = false;
lblWinampState.Text = "Closed";
}
Thread.Sleep(500);
}
}
catch (Exception E)
{
}
}
Link to original page
the site where it is meant to be hosted is down.
i think with winamp spam, and this i would be able to have my dp change to the album art?. i just dont know how to compile the source, if it is even all there.