Skip to content

Using JK’s API SPY

Viewing 5 posts - 31 through 35 (of 35 total)
  • Author
    Posts
  • #190413
    autopilot
    Member

    If you forget about the API calls fo a moment, what you must do is find the handle of the text box to send your message to. To ensure that you post to the right text box (a big consideration if you have more then one paltalk window open), you find the handel for the main chat window that you are working with (room box or pm box). Then you enum through the children untill you find the text box. Once you have that handle, you are able to sendmessage to it.
    That being said, you have to have a way to find the handles to the different forms and controls on the forms. If you are not used to using api’s, this program is a nice helper to give you the code example with relitive values. So if you open the api spy tool, and click on the Code Generator tab, then drag the yellow dot onto the frame or title bar of the chat room window (not the body of the form), it will generate the code that has the class name already filled in.
    Pal 8.x

    Dim mywindowclass As Long
    mywindowclass = FindWindow("my window class", vbNullString)

    Pal 9.x

    Dim dlggroupchatwindowclass As Long
    dlggroupchatwindowclass = FindWindow("dlggroupchat window class", vbNullString)

    The reason for the difference is that in paltalk 9 they changed the class name of the chat windows. This is why the programs that worked with pal8 dont work with pal9.

    autopilot

    By the way, any one else here using VS2005? I am in need of help inserting into paltalk memory space to read the syslistview32 control. But that is another post i guess.

    #190412
    Ponies
    Member

    Fuck you ghost.

    #190411
    autopilot
    Member

    @nanomachine007 wrote:

    dude you have to read this post and thing in that session cuz c#.net anh vbnet have something semilar

    That is what I have been looking for… thank you so much! I don’t know how I missed it! Every post that I found elsewhere wanted to use C to make a dll to inject and then call… This is so much less complecated!

    Thanks again

    Sorry I hijacked the thread

    autopilot

    #190410
    Admin
    Administrator

    OK this is the code i did….i think i understand now…..but it doesnt work…can u tell me why? its for 8.5 build 157.

    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 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 GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
    Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Const GW_CHILD = 5 Private Const GW_HWNDNEXT = 2 Private Const WM_GETTEXT = &HD Private Const WM_GETTEXTLENGTH = &HE Private Const WM_SETTEXT = &HC Private Const WM_KEYDOWN = &H100
    `Private Sub Command1_Click()
    Dim wtlsplitterwindow As Long, atl As Long, atlaxwin As Long
    Dim x As Long, richedita As Long
    Dim mywindowclass As Long
    mywindowclass = FindWindow("my window class", vbNullString)
    wtlsplitterwindow = FindWindow("wtl_splitterwindow", vbNullString)
    wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
    wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
    atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00546990", vbNullString)
    atlaxwin = FindWindowEx(atl, 0&, "atlaxwin71", vbNullString)
    x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
    richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
    richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
    Call SendMessageSTRING(richedita, WM_SETTEXT, 0&, Text1.Text)
    Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
    End Sub`
    #190409
    autopilot
    Member

    To tie this together, there is one thing you need to change in the button code

    Private Sub Command1_Click()
    Dim wtlsplitterwindow As Long, atl As Long, atlaxwin As Long
    Dim x As Long, richedita As Long
    Dim mywindowclass 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)
    atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00545990", vbNullString)
    atlaxwin = FindWindowEx(atl, 0&, "atlaxwin71", vbNullString)
    x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
    richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
    richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
    Call SendMessageSTRING(richedita, WM_SETTEXT, 0&, "The Zone is my home")
    Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
    End Sub

    You must change the first line from the code generated for the textbox to link it to the handle for the main window.

    Good luck getting a handle on the API calls.

    autopilot

Viewing 5 posts - 31 through 35 (of 35 total)
  • You must be logged in to reply to this topic.