Jump to content

Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  yordan : (14 April 2014 - 05:28 PM) By The Way, This Could Be An Interesting Subject For A Topic, What About Posting This Question? Let's See If Other People Have The Same Feeling Concerning Bootlists!
@  yordan : (13 April 2014 - 09:36 AM) Boot Order : Cd, [Usb,] Hard Drive :D
@  yordan : (11 April 2014 - 07:23 PM) I Simply Let The Bios Do That
@  Ritesh : (11 April 2014 - 10:23 AM) Is It Possible To Launch Fedora Live Cd Or Installation Disk From Hard Drive On Windows Platform Using Grub Mbr File.
@  Ritesh : (11 April 2014 - 10:21 AM) No U Are Not.. Btw.. I Have Question For You.
@  yordan : (10 April 2014 - 08:02 AM) You Are Partially Right.
I Was Not.
Nevertheless, I Am Again :)
@  Ritesh : (09 April 2014 - 07:33 PM) :P
@  Ritesh : (09 April 2014 - 07:33 PM) I Think U R Not..
@  yordan : (09 April 2014 - 09:28 AM) I'm The Master Of The Shoutbox!
@  yordan : (05 April 2014 - 10:32 PM) He-He
@  Ritesh : (04 April 2014 - 06:59 PM) Ha Ha Ha ....
@  yordan : (04 April 2014 - 11:15 AM) Welcome Back, Starscream!
@  yordan : (03 April 2014 - 02:31 PM) And I Hope That He Will Come Back Soon :)
@  yordan : (01 April 2014 - 02:53 PM) Nice, Ritesh Came, I'm Not Home Alone Today.
@  Ritesh : (01 April 2014 - 08:51 AM) Oh!!! Poor Dear Yordan..
@  yordan : (31 March 2014 - 10:02 AM) I'm A Poor Lonesome Cow-Boy
@  yordan : (27 March 2014 - 02:22 PM) He Is Unpatient Due To His Patients!
@  Ritesh : (27 March 2014 - 10:46 AM) :(
@  Ritesh : (27 March 2014 - 10:46 AM) He Is Busy With His Patients.
@  yordan : (26 March 2014 - 08:12 PM) Ahsani, Where Are You?

- - - - -

Vb.net And Windows Live Messenger Plugin

3 replies to this topic

#1 Jimmy89


    Living at the Datacenter

  • [HOSTED]
  • 713 posts
  • Gender:Male
  • Location:Australia
  • myCENTs:14.01

Posted 17 January 2008 - 08:14 AM

I am currently developing a media player for a friend. I amusing VB.Net and just making him a quick program. He asked whether it was possible to link it with the messenger live music plugin (like the one used in WMP). I said i'll get back to him on that.

What i would like to know is where to start? I have found a dll in the Live Messenger directory that can is called 'psmsong.8.1.0178.00.dll' and has a description of 'MSN Messenger Status Plugin' How can i implement this into the program. I have a way of passing current details (artist, album, song, current time, etc) but i just need to know how to get that to Live Messenger.


#2 FirefoxRocks


    Super Member

  • [HOSTED]
  • 988 posts
  • Gender:Male
  • Location:Ontario, Canada
  • myCENTs:92.36

Posted 18 January 2008 - 01:15 AM

I don't know if it will help or not, but maybe taking a look at this will give you some ideas:


It's really old and obviously hasn't been updated, last support was for Firefox 1.5. But it is almost the same feature, putting the data in the Music portion of Windows Live Messenger.

#3 Jimmy89


    Living at the Datacenter

  • [HOSTED]
  • 713 posts
  • Gender:Male
  • Location:Australia
  • myCENTs:14.01

Posted 18 January 2008 - 05:18 AM

FirefoxRocks, Thanks for that link. That is the kind of idea I'm looking for, but I think i've solved my own problem. ^_^

I did a bit more digging around the Internet and stumbled upon the Fanatic Forums. I had a look around (its a great place for coding) and found a thread about this exact topic, and sure enough there was code on how to do it! Boy was i excited! ;) I copied the code and right away it worked! I'll copy the code here for anyone that wants to have a look at it, but this is all from http://forums.fanatic.net.nz/.

Firstly, declare the following.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal Hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
	Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
	Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer

	Private Const WM_COPYDATA As Short = &H4AS

Then, Put this code into the same form,
Public Function VarPtr(ByVal o As Object) As Integer
		Dim GC As System.Runtime.InteropServices.GCHandle = System.Runtime.InteropServices.GCHandle.Alloc(o, System.Runtime.InteropServices.GCHandleType.Pinned)
		Dim ret As Integer = GC.AddrOfPinnedObject.ToInt32

		Return ret
	End Function

	Private Structure COPYDATASTRUCT
		Dim dwData As Integer
		Dim cbData As Integer
		Dim lpData As Integer
	End Structure

	Public Sub SetMusicInfo(ByRef r_sArtist As String, ByRef r_sAlbum As String, ByRef r_sTitle As String, Optional ByRef r_sWMContentID As String = vbNullString, Optional ByRef r_sFormat As String = "{1} - {0}", Optional ByRef r_bShow As Boolean = True)

		Dim sBuffer As String
		Dim hMSGRUI As Integer

		'Total length can not be longer then 256 characters!
		'Any longer will simply be ignored by Messenger.
		sBuffer = "Music\" & System.Math.Abs(CInt(r_bShow)) & "\" & r_sFormat & "\" & r_sArtist & "\" & r_sTitle & "\" & r_sAlbum & "\" & r_sWMContentID & "\" & vbNullChar

		udtData.dwData = &H547S
		udtData.lpData = VarPtr(sBuffer)
		udtData.cbData = Len(sBuffer) * 2

			hMSGRUI = FindWindowEx(0, hMSGRUI, "MsnMsgrUIManager", vbNullString)

			If (hMSGRUI > 0) Then
				Call SendMessage(hMSGRUI, WM_COPYDATA, 0, VarPtr(udtData))
			End If

		Loop Until (hMSGRUI = 0)
	End Sub

And then, place these codes whenever you want to change or clear what is being sent to Messenger.

'Displays song info (MSN Messenger)
Call SetMusicInfo(My.Settings.CurrentArtistPlaying, "Not Passed", My.Settings.CurrentSongPlaying)
'Clear song info
Call SetMusicInfo("", "", "", , , False)
For some reason, the second variable in 'SetMusicInfo' doesn't pass to Messanger, not that bothers me cause i don't need it! This was tested with Windows Live Messenger 8.1 (Build 8.1.0178.00)


#4 Guest_FeedBacker_*

  • Guests

Posted 30 May 2008 - 01:47 PM

Strange Error
Vb.net And Windows Live Messenger Plugin

Hi there, this looks exactly what I need for a personal project I'm working on. However I keep on getting the error:

'Settings' is not a member of 'My'

The code works fine up to the point where I use the Call SetMusicInfo function. If I understand it correctly, this should appear in Sub Page_Load, whenever I want this to display.

Any ideas?



-question by Douglas

Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users