Il sert à faire des action sur msn ( la classe hein ^^ )
Fonctions dans l'UDF:
-Modifier le commentaire perso ( normal )
-Modifier le commentaire perso ( sound )
Fonctions manquantes ( que je ne trouve pas ) :
-Modifier le message perso
-Envoyer un message à tous les contacts
-Prendre l'image perso d'un contact
-bloquer un contact
-afficher un toast ( notification )
(merci à ceux qui m'aide) cette UDF peut être très utile pour certains qui veulent faire des scripts pour MSN
Code : Tout sélectionner
Func ChangeMSNMessage($iType, $bEnable, $szText) ; modifie le commentaire msn perso pour la musique
Local Const $szFormat = "CoePSX\\0%s\\0%d\\0{0}\\0%s\\0\\0\\0\\0\\0"
Local Const $WM_COPYDATA = 0x4A
Local $szType
Local $szMessage
Local $iSize
Local $pMem
Local $stCopyData
Local $hWindow
$szType = "Music"
$szMessage = StringFormat($szFormat, $szType, $bEnable, $szText)
$iSize = StringLen($szMessage) + 1
$pMem = DllStructCreate("ushort[" & $iSize & "]")
For $i = 0 To $iSize
DllStructSetData($pMem, 1, Asc(StringMid($szMessage, $i, 1)), $i)
Next
DllStructSetData($pMem, 1, 0, $iSize)
$stCopyData = DllStructCreate("uint;uint;ptr")
DllStructSetData($stCopyData, 1, 0x547)
DllStructSetData($stCopyData, 2, ($iSize * 2))
DllStructSetData($stCopyData, 3, DllStructGetPtr($pMem))
$hWindow = DllCall("user32", "hwnd", "FindWindowExA", "int", 0, "int", 0, "str", "MsnMsgrUIManager", "int", 0)
DllCall("user32", "int", "SendMessageA", "hwnd", $hWindow[0], "int", $WM_COPYDATA, "int", 0, "ptr", DllStructGetPtr($stCopyData))
$hWindow = DllCall("user32", "hwnd", "FindWindowExA", "int", 0, "hwnd", $hWindow[0], "str", "MsnMsgrUIManager", "int", 0)
$pMem = 0
$stCopyData = 0
EndFunc
Func SetPSM($text) ; modifie le commentaire msn perso en normal
$hParentWnd = WinGetHandle("[CLASS:MSBLWindowClass]","")
If $hParentWnd <> 0 Then
$hChildWnd = ControlGetHandle($hParentWnd,"", "[CLASS:DirectUIHWND]")
If $hChildWnd <> 0 Then
SendMessage($hParentWnd, 0x111, 56606, 0)
For $i = 1 To StringLen($text)
SendMessage($hChildWnd, 0x102, Asc(StringMid($text, $i, 1)), 0)
Next
SendMessage($hChildWnd, 0x102, 0xD, 0)
EndIf
EndIf
EndFunc
Func SendMessage($hwnd,$wMsg,$wParam,$lParam)
$dc = DllCall("User32.dll", "Long", "SendMessage", "Long", $hwnd, "Long", $wMsg, "Long", $wParam, "Long", $lParam)
EndFunc