begin process at 2008 07 07 02:58:43
1 205 881 membres
32 nouveaux aujourd'hui
14 120 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Urgent: imiter ComboBox d'AOL [ Archives Visual Basic / J'AI BESOIN D'AIDE !!!! :) ] (Xephyr)

Urgent: imiter ComboBox d'AOL le 04/05/2003 19:14:52

Xephyr
Salut, je voudrais obtenir un combobox avec les pseudonymes de l'utilisateur AOL (imiter le combobox de "Mon pseudonyme" de la fenêtre de connexion AOL). Si quelqu'un pouvait me dire comment faire... Merci et bonne continuation ;)

Re : Urgent: imiter ComboBox d'AOL le 22/02/2004 00:08:23

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



Classé sous : combobox, urgent, aol, imiter

Participer à cet échange

Livres en rapport

Pub



Appels d'offres

Realisation graphique ...
Budget : 700€
WEB DESIGN
Budget : 1 000€
Plugin Dialer outlook
Budget : 2 000€

CalendriCode

Juillet 2008
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

VS Express FR Gratuit !

VS Express en français et 100% gratuit !

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS