PDA

Click to See Complete Forum and Search --> : Question about MSN


SkettaLEE
Oct 15th, 2001, 04:51 PM
How can i make my program type in MSN Messenger? Like an Away For Keyboard bot or something. When someone comes up and I make it send a message to them saying something... I try with SendMessage WM_SETTEXT or whatever and instead of the words i want......... it gives me characters.... Ill show you what My code is right now :


On Error GoTo DamnyoMomma


For TheNum = 0 To lsthandle.ListCount
Instant% = lsthandle.List(TheNum)

Win% = GetWindow(Instant%, GW_CHILD)

Do
Text2$ = GetClass(Win%)

If Text2$ = "RichEdit20A" Then Exit Do

Win% = GetWindow(Win%, GW_HWNDNEXT)
Loop Until Win% = 0

WinEdit% = GetWindow(Win%, GW_HWNDNEXT)
WinEdit% = GetWindow(WinEdit%, GW_HWNDNEXT)
Text2$ = GetClass(WinEdit%)
'MsgBox Text2$


Text& = SendMessage(Win%, WM_GETTEXTLENGTH, 0&, 0&)
Cursor$ = String(Text&, 0&)
Call SendMessageByString(Win%, WM_GETTEXT, Text& + 1, Cursor$)
If Cursor$ = DogImCountingn Then Exit Sub
DogImCounting = Cursor$

Do While InStr(Cursor$, ":")
d = InStr(Cursor$, ":")
LastOfIt = Mid$(Cursor$, d + 1, Len(Cursor$))
If InStr(LastOfIt, ":") = False Then
Exit Do
Else
Cursor$ = LastOfIt
End If
Loop
Cursor$ = Right$(LastOfIt, Len(LastOfIt) - 2)

' This is the line of code that does the commands for
' whatever the user types in

If InStr(LCase(Cursor$), "end") Then End
If InStr(LCase(Cursor$), "hello") Then
SendMessage WinEdit%, WM_SETTEXT, ByVal 0, "Sorry im not here"
End If

Next TheNum
DamnyoMomma:


On my program it has a listbox with all the handles of the current open message windows..


Some please help me!

DaoK
Oct 15th, 2001, 05:08 PM
If you are using vb use : [vbcode ] CODE HERE [ / vbcode]

DaoK
Oct 15th, 2001, 05:09 PM
On Error GoTo DamnyoMomma


For TheNum = 0 To lsthandle.ListCount
Instant% = lsthandle.List(TheNum)

Win% = GetWindow(Instant%, GW_CHILD)

Do
Text2$ = GetClass(Win%)

If Text2$ = "RichEdit20A" Then Exit Do

Win% = GetWindow(Win%, GW_HWNDNEXT)
Loop Until Win% = 0

WinEdit% = GetWindow(Win%, GW_HWNDNEXT)
WinEdit% = GetWindow(WinEdit%, GW_HWNDNEXT)
Text2$ = GetClass(WinEdit%)
'MsgBox Text2$


Text& = SendMessage(Win%, WM_GETTEXTLENGTH, 0&, 0&)
Cursor$ = String(Text&, 0&)
Call SendMessageByString(Win%, WM_GETTEXT, Text& + 1, Cursor$)
If Cursor$ = DogImCountingn Then Exit Sub
DogImCounting = Cursor$

Do While InStr(Cursor$, ":")
d = InStr(Cursor$, ":")
LastOfIt = Mid$(Cursor$, d + 1, Len(Cursor$))
If InStr(LastOfIt, ":") = False Then
Exit Do
Else
Cursor$ = LastOfIt
End If
Loop
Cursor$ = Right$(LastOfIt, Len(LastOfIt) - 2)

' This is the line of code that does the commands for
' whatever the user types in

If InStr(LCase(Cursor$), "end") Then End
If InStr(LCase(Cursor$), "hello") Then
SendMessage WinEdit%, WM_SETTEXT, ByVal 0, "Sorry im not here"
End If

Next TheNu

DaoK
Oct 15th, 2001, 05:14 PM
This link might help you : Link #1 (http://forums.vb-world.net/showthread.php?threadid=108435&highlight=msn)

Link #2 (http://forums.vb-world.net/showthread.php?threadid=103731&highlight=msn)