
LolPiratas
|
Yo ManaM oY bon ecoute ya un petit momet que j eme penche sur la question et je plante quelque pars car je n'ais jamais les speudo exact alors si tu cherche en meme temps que moi ca serais cool voila mon code
tu colle ca dans une form et tu te met sur connexion de demarrage d'aol
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 GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (destination As Any, source As Any, ByVal Length As Long) Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Private Const PROCESS_READ = &H10 Private Const RIGHTS_REQUIRED = &HF0000
Private Const CB_GETCOUNT = &H146 Private Const CB_GETITEMDATA = &H150
Private Sub Command1_Click() Combo1.Refresh Combo1.Clear AddRoomToList Combo1, True
End Sub
Private Function FindRoom() As Long Dim AOL As Long, mdi As Long, child As Long Dim Rich As Long, AOLList As Long Dim AOLIcon As Long, AOLStatic As Long AOL& = FindWindow("AOL Frame25", vbNullString) mdi& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString) child& = FindWindowEx(mdi&, 0&, "AOL Child", vbNullString) AOLList& = FindWindowEx(child&, 0&, "_AOL_Combobox", vbNullString) FindRoom& = child& Exit Function Do child& = FindWindowEx(mdi&, child&, "AOL Child", vbNullString) AOLList& = FindWindowEx(child&, 0&, "_AOL_Combobox", vbNullString) FindRoom& = child& Exit Function Loop Until child& = 0& FindRoom& = child& End Function
Private Sub AddRoomToList(TheList As ComboBox, AddUser As Boolean) On Error Resume Next Dim cProcess As Long, itmHold As Long, ScreenName As String Dim psnHold As Long, rBytes As Long, index As Long, Room As Long Dim rList As Long, sThread As Long, mThread As Long Room& = FindRoom& If Room& = 0& Then Exit Sub rList& = FindWindowEx(Room&, 0&, "_AOL_Combobox", vbNullString) sThread& = GetWindowThreadProcessId(rList, cProcess&) mThread& = OpenProcess(PROCESS_READ Or RIGHTS_REQUIRED, False, cProcess&) If mThread& Then For index& = 0 To SendMessage(rList, CB_GETCOUNT, 0, 0) - 1 ScreenName$ = String$(4, vbNullChar) itmHold& = SendMessage(rList, CB_GETITEMDATA, ByVal CLng(index&), ByVal 0&) itmHold& = itmHold& + 28 Call ReadProcessMemory(mThread&, itmHold&, ScreenName$, 4, rBytes) Call CopyMemory(psnHold&, ByVal ScreenName$, 4) psnHold& = psnHold& + 16 ScreenName$ = String$(16, vbNullChar) Call ReadProcessMemory(mThread&, psnHold&, ScreenName$, Len(ScreenName$), rBytes&) ScreenName$ = Left$(ScreenName$, InStr(ScreenName$, vbNullChar) - 1) If ScreenName$ <> GetUser$ Or AddUser = True Then TheList.AddItem ScreenName$ End If Next index& Call CloseHandle(mThread) End If End Sub
Private Sub Form_Load() Combo1.Refresh Combo1.Clear AddRoomToList Combo1, True Me.Caption = Usager End Sub Public Function Usager() As String On Error Resume Next Dim AOL As Long, mdi As Long, Bienvenue As Long Dim child As Long, Speudo As String AOL& = FindWindow("AOL Frame25", vbNullString) mdi& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString) child& = FindWindowEx(mdi&, 0&, "AOL Child", vbNullString) Speudo$ = GetCaption(child&) Usager$ = Speudo$ Exit Function Do child& = FindWindowEx(mdi&, child&, "AOL Child", vbNullString) Speudo$ = GetCaption(child&) Usager$ = Speudo$ Exit Function Loop Until child& = 0& Usager$ = "" End Function Public Function GetCaption(WindowHandle As Long) As String Dim Buffer As String, TextLength As Long TextLength& = GetWindowTextLength(WindowHandle&) Buffer$ = String(TextLength&, 0&) Call GetWindowText(WindowHandle&, Buffer$, TextLength& + 1) GetCaption$ = Buffer$ End Function
|