Bien sûr, à partir de toutes les fenêtres de conversation, un simple "/psm new message
" mettrait à jour le champ d'état du message.
Mais programme:
Vous trouverez ici un VB source file qui a envoyé un nouveau message à la PSM (Personal Satus message) de Windows Messenger Live. Peut être cela aiderait.
Extrait:
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_COMMAND = &H111
Private Const WM_CHAR = &H102
Private Const VK_RETURN = &HD
Private Function SetPSM(ByVal text As String) As Boolean
Dim hParentWnd, hChildWnd As Long
SetPSM = False
hParentWnd = FindWindow("MSBLWindowClass", vbNullString)
If hParentWnd <> 0 Then
hChildWnd = FindWindowEx(hParentWnd, 0, "DirectUIHWND", vbNullString)
If hChildWnd <> 0 Then
PostMessage hParentWnd, WM_COMMAND, 56606, 0
Dim i As Integer
For i = 1 To Len(text)
Call PostMessage(hChildWnd, WM_CHAR, Asc(Mid$(text, i, 1)), 0)
Next i
PostMessage hChildWnd, WM_CHAR, VK_RETURN, 0
SetPSM = True
End If
End If
End Function
Private Sub cmdSetPSM_Click()
SetPSM txtPSM.text
End Sub
Le "truc"/psm ne fonctionne pas. Juste essayé sur 14.0.5027.908 (la version bêta publique actuelle). –
De même, le code ne le fait pas non plus. FindWindow renvoie 0 pour MSBLWindowClass. –
Fonctionne parfaitement sur le 8.5.1302.1016 – VonC