envoyer du texte dans un salon aol.
Source / Exemple :
'nore-chatsend.bas
'par Seif.
'http://nore.owns.it/
'e-mail: xoyi@atern.org
'module: chatsend pour AOL 8 us, commentée. si ce chatsend est compatible avec d'autre version d'aol
'envoyé moi un mail pour me le dire, merci.
'merci à bob.
'Si vous utilisez ce chatsend pour créer un programme AOL, pensez à me faire un Greetz ! :)
'si vous ameliorez ce chatsend, ou si vous trouvez une erreur, ou autre, merci de me le faire savoir.
'greetz à bob, ganj et leb.
Option Explicit
'déclarations des APIs
Private Declare Function FindWindowEx& Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String)
Private Declare Function SendMessageString& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
'déclarations des constantes
Private Const WM_SETTEXT = &HC
Private Const WM_CHAR = &H102
Private Const VK_RETURN = &HD
Public Function chatsend(text As String) 'par Seif
'example: chatsend("prout")
On Error Resume Next
Dim room As Long, waol As Long, mdi As Long, child As Long, rich As Long
Dim list As Long, echange As Long, aolicon As Long
waol& = FindWindowEx(0&, 0&, "AOL Frame25", vbNullString) 'on cherche waol
mdi& = FindWindowEx(waol&, 0&, "MDIClient", vbNullString) 'on cherche la 2 eme parti de waol
child& = FindWindowEx(mdi&, 0&, "AOL Child", vbNullString) '1 ere fenetre
rich& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString) 'ou on ecrit
list& = FindWindowEx(child&, 0&, "_AOL_Listbox", vbNullString) 'la liste des pseudo
echange& = FindWindowEx(child&, 0&, "RICHCNTLREADONLY", vbNullString) 'ou tout le monde parle
aolicon& = FindWindowEx(child&, 0&, "_AOL_Icon", vbNullString) 'comme son nom l'indique
If rich& <> 0& And list& <> 0& And echange& <> 0& And aolicon& <> 0& Then 'tout est la ?
room& = child& 'si oui
If room& = 0& Then Exit Function 'on a pas trouvé
rich& = FindWindowEx(room&, 0&, "RICHCNTL", vbNullString) 'ou on ecrit
Call SendMessageString(rich&, WM_SETTEXT, 0&, (text$)) 'on met le texte
Call SendMessageLong(rich&, WM_CHAR, VK_RETURN, 0&) 'on appuie sur entrée
End If
End Function
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.