Skip to main content

Topic: album art msn dp changer. (Read 79277 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • bojo
  • [*][*]
album art msn dp changer.
hi,

i found this on the internet for winamp

Code: [Select]
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.

  • tool++
  • [*][*][*][*][*]
album art msn dp changer.
Reply #1
Whoa, that would be incredible. If a coder could look into getting this working for foo it would be fairly amazing :]
hi

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #2

  • bojo
  • [*][*]
album art msn dp changer.
Reply #3
was this in any way based on the code i supplied?... i can kinda read it, i sorted understand C++ and C is very similar.

i just had no idea on how to compile it, once u get into the correct formatting it gets confusing etc.

can sum1 recommend a decent site for learning C++?. I want to re-learn how to do it all, hopefully based around using the Visual C++ express edition, as most tutorials dont tell you how to compile properly using it.

cheers acropolis trying it out now

hmm it changes my first msn pic to the album, but each subsequent song changes it stays the same as the first song.

the window inside foobar changes its picture, but it doesnt change the one on msn.

  • PredUK
  • [*][*]
album art msn dp changer.
Reply #4
A nice way to fix that would be to add a button/command to perform the task of changing the MSN DP. Then it could be pressed in the fb2k main window or by using a hotkey.

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #5
A nice way to fix that would be to add a button/command to perform the task of changing the MSN DP. Then it could be pressed in the fb2k main window or by using a hotkey.


I don't like the way that, for each plugin related to pictures, it will have its own format string to locate the pictures, it is very annoying.
At first I attempted to add this "changing dp" feature in foo_msnalt, but I have no idea how to hook the foo_uie_albumart for the picture location (and the event to change picture) so I just simply modify the albumart plugin.
  • Last Edit: 19 June, 2006, 08:48:04 AM by Acropolis

  • bojo
  • [*][*]
album art msn dp changer.
Reply #6
acropolis? does it actively change your display picture?, like when it changes song does it change with it?

if its working fine for you, can u please tell me your msn version?. it changed once for me, and then decided not to do it anymore, weird :S

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #7
acropolis? does it actively change your display picture?, like when it changes song does it change with it?

if its working fine for you, can u please tell me your msn version?. it changed once for me, and then decided not to do it anymore, weird :S


I'm using live messenger 8.0 beta, yes, it changes picture for every song.

  • bojo
  • [*][*]
album art msn dp changer.
Reply #8
im using live beta aswell, strange cause i thort that would be the problem, ill see if ive got something in sources set wrong?. dunno if thats the cause, the panel shows that a picture is loaded, it just doesnt like changing it.

on a unrelated topic, can i look at the source code of your plugin?, i was aiming to try and make one myself, but i dont know how to program foobar plugins, and i dont know much about the msn api. figured if i had a look at what u did i mite be able to fill in the gaps?.

if im asking to much, just say so

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #9
im using live beta aswell, strange cause i thort that would be the problem, ill see if ive got something in sources set wrong?. dunno if thats the cause, the panel shows that a picture is loaded, it just doesnt like changing it.

on a unrelated topic, can i look at the source code of your plugin?, i was aiming to try and make one myself, but i dont know how to program foobar plugins, and i dont know much about the msn api. figured if i had a look at what u did i mite be able to fill in the gaps?.

if im asking to much, just say so


it seems the msn api use the old messenger executable's COM interface, propably you don't have it in:
"C:\Program Files\Messenger\msmsgs.exe"

I think you better take a look at the source of  foo_msnalt, because it's pretty simple, the source of the albumart involve with ui columns. Also, my code is not really based on what you provided previously, if you insists, I can provide it.

  • uberkrieg
  • [*]
album art msn dp changer.
Reply #10
hello. nice feature.
one question, does this only work with live messenger 8.0 beta?
Im using msn messenger 7.5 and it doesnt work. am Im missing something?

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #11
hello. nice feature.
one question, does this only work with live messenger 8.0 beta?
Im using msn messenger 7.5 and it doesnt work. am Im missing something?


I'm not sure, only tested with 8.0 beta.
what do u mean by doesn't work? the plugin is working but not changing the msn avator or something else?

  • uberkrieg
  • [*]
album art msn dp changer.
Reply #12

hello. nice feature.
one question, does this only work with live messenger 8.0 beta?
Im using msn messenger 7.5 and it doesnt work. am Im missing something?


I'm not sure, only tested with 8.0 beta.
what do u mean by doesn't work? the plugin is working but not changing the msn avator or something else?


hey, that was a fast reply
exactly. the panel shows the album art within fb2k without problems. but It doesnt do anything to the msn messenger DP.  do I need another pluggin or something?
  • Last Edit: 19 June, 2006, 02:27:27 PM by uberkrieg

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #13
ok, let me see what I can do, I have another computer running msn 7.5.
will be back with you soon.

  • uberkrieg
  • [*]
album art msn dp changer.
Reply #14
ok, let me see what I can do, I have another computer running msn 7.5.
will be back with you soon.


thank you so much.

/me waits


  • SOS
  • [*]
album art msn dp changer.
Reply #15
Thanks for the plugin.

I'm Windows Live Messenger 8.0.0689.00_Branches and it isn't working. The cover shows up in the panel but my display picture doesn't change.

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #16
@uberkrieg:
tried, it works fine, no problems.

@uberkrieg, @SOS:
do u have this file: "C:\Program Files\Messenger\msmsgs.exe" ? because it is the interface to ask msn to change the avator.
anyway, I've just uploaded a new one, it will print messges to the foobar console for any activities that involves the msn avator, tell me about any error messages.

0.2.1_1
  • Last Edit: 19 June, 2006, 03:23:08 PM by Acropolis

  • Andreasvb
  • [*][*][*][*][*]
album art msn dp changer.
Reply #17
Hi.

I'm having the same problem, here's what the console said:
foo_uie_albumart_msn: failed to create an instance of messenger (set_msn_dp)


I guess it's cause you use "Program Files". I'm on Swedish XP and we use "Program"

But I think you could use environment variables, like %PROGRAMFILES% which will use your Windows version's path for the "Program Files" path.

Great plugin otherwise =)

PS. I'ts called "Avatar"
  • Last Edit: 19 June, 2006, 03:36:14 PM by Andreasvb
Windows 10 Pro x64 // foobar2000 1.3.10

  • uberkrieg
  • [*]
album art msn dp changer.
Reply #18
this is what I get from console
"foo_uie_albumart_msn: failed to create an instance of messenger (set_msn_dp)"

and yeah, my installation path for msn messenger is different from
"C:\Program Files\Messenger\msmsgs.exe"

let my reinstall using that path.

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #19
@Andreasvb, @uberkrieg
The code doesn't actually use the fixed path: "C:\Program Files\Messenger\msmsgs.exe", it is the default path on my XP.

It uses COM interface, that mean it uses GUID to find the file, probably your msmsgs.exe is not registered in the system?
I suggest you to use any typelib viewers, e.g. oleview, to check if there's a typelib called: "Messenger API Type Library (Version 1.0)".

btw, thanks Andreasvb for the correction of the "avatar"
  • Last Edit: 19 June, 2006, 03:43:40 PM by Acropolis

  • Andreasvb
  • [*][*][*][*][*]
album art msn dp changer.
Reply #20
Maybe it's because I use WLM 8 Beta?

It uses this name, msnmsgr.exe and not msmsgs.exe

And my path is C:\Program\MSN Messenger\msnmsgr.exe
Windows 10 Pro x64 // foobar2000 1.3.10

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #21
Maybe it's because I use WLM 8 Beta?

It uses this name, msnmsgr.exe and not msmsgs.exe

And my path is C:\Program\MSN Messenger\msnmsgr.exe


no, I'm using 8 as well. the interface to change the avatar is only provided with msmsgs.exe.

Also, I think you should have another error message: "foo_uie_albumart_msn: failed to create an instance of messenger (get_msn_dp)", if so, I'm quite sure you are missing the typelib interface.
if you only have the set_msn_dp one, propably my coding problem then, your picture path has non english characters? because I can't test for non english words other than chinese.
  • Last Edit: 19 June, 2006, 03:52:17 PM by Acropolis

  • Andreasvb
  • [*][*][*][*][*]
album art msn dp changer.
Reply #22
I found this with oleview

Code: [Select]
 TypeLib
     {218CB45F-20B6-11D2-8E17-0000F803A446}

         1.0 = Messenger Type Library
             0
                 win32 = C:\Program\Messenger\msmsgs.exe

             FLAGS = 0
             HELPDIR =
  • Last Edit: 19 June, 2006, 04:07:01 PM by Andreasvb
Windows 10 Pro x64 // foobar2000 1.3.10

  • Acropolis
  • [*][*][*][*]
  • Banned
album art msn dp changer.
Reply #23
your one is not for the plugin, this is the correct one:

Code: [Select]
 TypeLib
     {E02AD29E-80F5-46C6-B416-9B3EBDDF057E}

         1.0 = Messenger API Type Library
             0
                 win32 = C:\Program\Messenger\msmsgs.exe\3
             FLAGS = 0
             HELPDIR =C:\WINDOWS\help

your second codebox has nothing to do with the plugin issue, IVIEWERS.DLL is just for oleview.

  • SOS
  • [*]
album art msn dp changer.
Reply #24
do u have this file: "C:\Program Files\Messenger\msmsgs.exe" ? because it is the interface to ask msn to change the avator.

No, I didn't have Windows Messenger installed.