On the same forum i see the answer (first i try to convert my own code but then i found it.. so i adapt to make it work)
code:
Public Class Form1
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 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 Structure COPYDATASTRUCT
Dim dwData As Integer
Dim cbData As Integer
Dim lpData As Integer
End Structure
Private Const WM_COPYDATA As Short = &H4AS
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 Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PonerMusica(TextBox1.Text)
End Sub
Public Sub PonerMusica(ByVal Texto)
'Public Sub PonerMusica(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 = "{0}", Optional ByRef r_bShow As Boolean = True)
Dim udtData As COPYDATASTRUCT
Dim sBuffer As String
Dim hMSGRUI As Integer
'sBuffer = "\0Music\0" & 1 & "\0" & "{0}" & "\0" & Texto & "\0" & "" & "\0" & "" & "\0" & vbNullString & "\0" & vbNullChar
sBuffer = "\0Music\0" & System.Math.Abs(CInt(True)) & "\0" & "{1} - {0}" & "\0" & Texto & "\0" & "" & "\0" & "" & "\0" & vbNullString & "\0" & vbNullChar
udtData.dwData = &H547
udtData.lpData = VarPtr(sBuffer)
udtData.cbData = Len(sBuffer) * 2
Do
' Buscamos la seccion del Msn donde se pone la musica
hMSGRUI = FindWindowEx(0, hMSGRUI, "MsnMsgrUIManager", vbNullString)
' La encontramos ?
If (hMSGRUI > 0) Then
' Esta es la linea que envia el Texto
Call SendMessage(hMSGRUI, WM_COPYDATA, 0, VarPtr(udtData))
End If
Loop Until (hMSGRUI = 0)
End Sub
End Class
Source:
http://forums.fanatic.net.nz/index.php?s=&showtop...w=findpost&p=83457