PDA

Click to See Complete Forum and Search --> : Api


VBTZH
Sep 9th, 2001, 02:36 PM
Hiya,

I'm a member on the MSN Gamign Zone and i really want to make a new program for people to send text to a lobby or chat room via this program.

Does anyone know how to do this with API?

Vlatko
Sep 9th, 2001, 03:23 PM
See the winsock functions in Api_guide or at www.vbapi.com. Just remember that winsock is pretty much complex. Also search planetsourcecode for chat examples.

DaoK
Sep 9th, 2001, 08:51 PM
What is your zone name and what game do you play?

VBTZH
Sep 10th, 2001, 12:09 PM
Hiya,

My zone name is MCA_Leader and I play Backgammon, Ants, AOE and some other games.


Mike

"Stay Cool. Or Stay Alive"

AutoBot
Sep 10th, 2001, 09:19 PM
This isn't what you asked but I did it before I understood your question but it gives an example of how to send text to internet explorer and click the go button.


'create a form with a Command1 and Command2 button
'and a textbox


Private Sub Command1_Click()

Dim ieframe As Long, workerw As Long, rebarwindow As Long
Dim comboboxex As Long, combobox As Long, editx As Long
ieframe = FindWindow("ieframe", vbNullString)
workerw = FindWindowEx(ieframe, 0&, "workerw", vbNullString)
rebarwindow = FindWindowEx(workerw, 0&, "rebarwindow32", vbNullString)
comboboxex = FindWindowEx(rebarwindow, 0&, "comboboxex32", vbNullString)
combobox = FindWindowEx(comboboxex, 0&, "combobox", vbNullString)
editx = FindWindowEx(combobox, 0&, "edit", vbNullString)
Call SendMessageByString(editx, WM_SETTEXT, 0&, Text1.Text)

End Sub



Private Sub Command2_Click()

Dim ieframe As Long, workerw As Long, rebarwindow As Long
Dim comboboxex As Long, toolbarwindow As Long
ieframe = FindWindow("ieframe", vbNullString)
workerw = FindWindowEx(ieframe, 0&, "workerw", vbNullString)
rebarwindow = FindWindowEx(workerw, 0&, "rebarwindow32", vbNullString)
comboboxex = FindWindowEx(rebarwindow, 0&, "comboboxex32", vbNullString)
toolbarwindow = FindWindowEx(comboboxex, 0&, "toolbarwindow32", vbNullString)
Call SendMessageLong(toolbarwindow, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessageLong(toolbarwindow, WM_LBUTTONUP, 0&, 0&)

End Sub



'put this code in a module



Public 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
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)

Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_SETTEXT = &HC