|
|
|
| Web Hosting |
![]() ![]() |
Vb.net And Windows Live Messenger Plugin |
Jan 17 2008, 08:14 AM
Post
#1
|
|
|
Living at the Datacenter Group: [HOSTED] Posts: 708 Joined: 30-June 06 From: Australia Member No.: 14,219 myCENTs:76.93 |
HI,
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. Thanks -jimmy |
|
|
|
Jan 18 2008, 01:15 AM
Post
#2
|
|
|
Super Member Group: [HOSTED] Posts: 774 Joined: 12-July 06 From: Ontario, Canada Member No.: 14,464 myCENTs:42.53 |
I don't know if it will help or not, but maybe taking a look at this will give you some ideas:
https://addons.mozilla.org/en-US/firefox/addon/2434 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. |
|
|
|
Jan 18 2008, 05:18 AM
Post
#3
|
|
|
Living at the Datacenter Group: [HOSTED] Posts: 708 Joined: 30-June 06 From: Australia Member No.: 14,219 myCENTs:76.93 |
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! Firstly, declare the following. CODE 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, CODE 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 GC.Free() 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 udtData As COPYDATASTRUCT 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 Do 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. CODE 'Displays song info (MSN Messenger) Call SetMusicInfo(My.Settings.CurrentArtistPlaying, "Not Passed", My.Settings.CurrentSongPlaying) CODE '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) Enjoy! |
|
|
|
May 30 2008, 01:47 PM
Post
#4
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
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? Thanks Douglas -question by Douglas |
|
|
|
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
22 | ninjamunky | 9,662 | Yesterday, 01:53 PM Last post by: iG- |
|||
![]() |
43 | snutz411 | 3,272 | 4th January 2009 - 08:46 PM Last post by: iG-Pax |
|||
![]() |
4 | tansqrx | 1,148 | 3rd January 2009 - 05:17 AM Last post by: iG-dyoung |
|||
![]() |
19 | TehJohn | 517 | 2nd January 2009 - 11:37 PM Last post by: xboxrulz |
|||
![]() |
6 | jess704 | 151 | 2nd January 2009 - 11:17 AM Last post by: sakmac |
|||
![]() |
5 | rahid | 277 | 1st January 2009 - 02:31 PM Last post by: sakmac |
|||
![]() |
4 | sonoftheclayr | 2,402 | 29th December 2008 - 09:11 PM Last post by: Guest |
|||
![]() |
2 | Niru | 112 | 28th December 2008 - 03:45 AM Last post by: turbopowerdmaxsteel |
|||
![]() |
2 | sparkx | 149 | 26th December 2008 - 06:17 PM Last post by: xboxrulz |
|||
![]() |
7 | mikesoft | 635 | 25th December 2008 - 01:33 PM Last post by: iG-devendra |
|||
![]() |
2 | TavoxPeru | 198 | 24th December 2008 - 02:24 AM Last post by: TavoxPeru |
|||
![]() |
9 | sitekeen | 1,243 | 23rd December 2008 - 04:21 PM Last post by: Nabb |
|||
![]() |
25 | Arttymis | 8,602 | 23rd December 2008 - 01:44 AM Last post by: laniczech |
|||
![]() |
14 | FirefoxRocks | 1,300 | 21st December 2008 - 08:38 AM Last post by: kpxchunsa |
|||
![]() |
10 | FirefoxRocks | 989 | 18th December 2008 - 05:24 PM Last post by: magiccode9 |
|||
|
Lo-Fi Version | Time is now: 9th January 2009 - 09:25 AM |
© 2009 AstaHost: Free Web Hosting & Technical Discussion, Free Web Hosting. a member of xisto.
Powered by Invision Board. Skin: IPB Forum Skins
Expand / Collapse Navigation



Jan 17 2008, 08:14 AM





