Aigh this is going to be a simple tutorial for using the api spy, now for this tutorial i will use example of codes from other programs
lets get started first get JK's API SPY here
http://www.imfiles.com/Software/Prog ... 1_L62.html
Now we going to use to actions for this tutorial but you will get the basic once u understand it,
We will find the text area of paltalk to send text to the paltalk room
open paltalk and also open the apy spy.
Now on api spy click on code generator you should be in this window then
Now you see the rounded yellow ball click on it and drag it to the paltalk text are, you know where you type the text after you drag it to the text area just let the mouse go then this code should come up on the righbox of the api spy.
- Code: Select all
Dim wtlsplitterwindow As Long, atl 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)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00692658", 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)
wallah thas the api for the text area.
Okie now we need to find the main window of the text area, which is the window where the text area is located,
now drang the yellow ball to the borders of the paltalk room window and you should get this code
- Code: Select all
Dim dlggroupchatwindowclass As Long
dlggroupchatwindowclass = FindWindow("dlggroupchat window class", vbNullString)
Now what we are planning on doing at this point is send text so we will use this send string code, this where shit get tricky there many ways to do this but this is the simpliest, getting the apis is usually the hardest part of the coding, anyways we goign to use this code
- Code: Select all
Call SendMessageSTRING(richedita, WM_SETTEXT, 0&, Text1.Text)
Note Text1.Text will be the text are in our program that we'll use to write the text we will send to the room.
okie now lets put the code together it should look like this
- Code: Select all
Dim wtlsplitterwindow As Long, atl As Long, atlaxwin As Long
Dim x As Long, richedita As Long
Dim dlggroupchatwindowclass As Long
dlggroupchatwindowclass = FindWindow("dlggroupchat window class", vbNullString)
wtlsplitterwindow = FindWindowEx(dlggroupchatwindowclass, 0, "WTL_SplitterWindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00692658", 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)
The important thing about coding with apis is putting things together like this part of the code for example we pu together the text area with the main window
- Code: Select all
wtlsplitterwindow = FindWindowEx(dlggroupchatwindowclass, 0, "WTL_SplitterWindow", vbNullString)
and we did the same thing with the SendMessageSTRING
- Code: Select all
Call SendMessageSTRING(richedita, WM_SETTEXT, 0&, Text1.Text)
you see how we added dlggroupchatwindowclass into the text are code, thas how we put it together, now to finalize it we want to also send the text to the room so we add to the code this
- Code: Select all
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
so the final code should look like this
- Code: Select all
Dim wtlsplitterwindow As Long, atl As Long, atlaxwin As Long
Dim x As Long, richedita As Long
Dim dlggroupchatwindowclass As Long
dlggroupchatwindowclass = FindWindow("dlggroupchat window class", vbNullString)
wtlsplitterwindow = FindWindowEx(dlggroupchatwindowclass, 0, "WTL_SplitterWindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00692658", 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&)
aigh the code is done all we need to do is declare the apis in this example we use this
- Code: Select all
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
check the attachment code to see how it goes all together
this shit still a little confusing but if you see the basics of first how to get the apis and then how to connect them together u will have abetta understanding






