Call RoomSend

You can talk about VB programming here

Postby locohacker » Thu Apr 13, 2006 8:15 am


lol man its hard to explain, the way I do it and most of us is we use an api spymprogram to get the handle of the box where we want to send the text to, I personally use this program

http://www.imfiles.com/Software/Prog ... 1_L62.html

and I really dont know how thing work behind it :)

for example if you use the program and u click on Code Generator then you drag the yellow ball to the text box of the paltalk room you will get something like this

Code: Select all
Dim wtlsplitterwindow As Long, atld As Long, atlaxwin As Long
Dim x As Long, richedita As Long
wtlsplitterwindow = FindWindow("wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:0053d798", vbNullString)
atlaxwin = FindWindowEx(atld, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)


Now in this code we intersted on sending text to richedita so we use a sendmessege api to do this by adding to the code this

Code: Select all
Call SendMessageByString(richedita, WM_SETTEXT, 0&, Text$)


where Text$ is an alvitrary textbox we may use :)

so the code woul look like this

Code: Select all
Dim wtlsplitterwindow As Long, atld As Long, atlaxwin As Long
Dim x As Long, richedita As Long
wtlsplitterwindow = FindWindow("wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:0053d798", vbNullString)
atlaxwin = FindWindowEx(atld, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, Text$)


then in the form itself we put the call to this code by usin this

Code: Select all
Call RoomSend(RichTextBox1.TextRTF)


where RichTextBox1.TextRTF is where the text is, you can also use a textbox and the code would look like this then

Code: Select all
Call RoomSend(Text1.Text)


lol its a little hard to explain but thas how i go bout it :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby method » Thu Apr 13, 2006 8:41 am

Thank u for u nice explaination but i think u explained part of the module code! did u clean up the above code or all parts are required? Furthermore, if i want to change my target window forexample for msn . What part needs to be change ?Any ways i do not know how to fix my own code :-(
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby locohacker » Thu Apr 13, 2006 10:10 am

Ah, you have to use the api spy to do that and someitmes it dont even work, let give it a quick look too see, but like I say you can try use the api spy drag the yellow ball, by clicing on it then drag it to the text box of msn, then you will see the code generated :) I never done program for msn so I gonna check it to see if it works :wink:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby method » Sat May 27, 2006 5:10 pm

Hi loco i try to send text to search room textbox but it does not work. i used api spy and did what u suggst but it does not work. could u help me here?Thanks


Code: Select all


Option Explicit
Public Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) 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 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 ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Public Const BM_SETCHECK = &HF1
Public Const BM_GETCHECK = &HF0

Public Const CB_GETCOUNT = &H146
Public Const CB_GETLBTEXT = &H148
Public Const CB_SETCURSEL = &H14E

Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDNEXT = 2
Public Const GW_CHILD = 5

Public Const LB_GETCOUNT = &H18B
Public Const LB_GETTEXT = &H189
Public Const LB_SETCURSEL = &H186

Public Const SW_HIDE = 0
Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_NORMAL = 1
Public Const SW_SHOW = 5

Public Const VK_SPACE = &H20

Public Const WM_CHAR = &H102
Public Const WM_CLOSE = &H10
Public Const WM_COMMAND = &H111
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_MOVE = &HF012
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_SETTEXT = &HC
Public Const WM_SYSCOMMAND = &H112
Sub RoomSend(Text As String)
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atld As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
Dim Button As Long
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:0053d798", vbNullString)
atlaxwin = FindWindowEx(atld, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, Text$)

If richedita = 0 Then
 
    Exit Sub
End If

Do
    DoEvents
   mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:0053d798", vbNullString)
atlaxwin = FindWindowEx(atld, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
    richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
    Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
Loop Until richedita <> 0
End Sub



method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Previous

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests