Using JK's API SPY

Here you will find tutorials that will help you with programming.

Using JK's API SPY

Postby locohacker » Wed Nov 08, 2006 11:45 am


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
Image
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 :)
Attachments
Sen9.rar
This code was first made by nano
(1.7 KiB) Downloaded 189 times
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Postby Ghost » Wed Nov 08, 2006 1:52 pm

umm...didnt syxx make a tut about this before?
Ghost
 

Postby locohacker » Wed Nov 08, 2006 2:14 pm

yeps it was even betta but ll his tut pics are gone :cry:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Postby NinjaCoder » Wed Nov 08, 2006 3:35 pm

yea it was good up to a point...until he lost me completely n i had no clue what to do...lol.....im gunna check this one out n see if i can understand it
NinjaCoder
 

Postby ii Rocky ii » Wed Nov 08, 2006 3:56 pm

its rock man thx for this its dam easy thx once again LOCO
The Rock, KaTiL
User avatar
ii Rocky ii
imFiles Junior
imFiles Junior
 
Posts: 86
Joined: Mon Oct 02, 2006 2:50 pm
Location: I will fuck the paltalk soon

Postby GODFATHER-GM_01 » Wed Nov 08, 2006 5:14 pm

men i suck i cant do it im lose lik always :roll:
Image
User avatar
GODFATHER-GM_01
Forum Moderator
Forum Moderator
 
Posts: 221
Joined: Tue Jul 11, 2006 1:02 am
Location: GYPSY MOBB

Postby locohacker » Wed Nov 08, 2006 10:56 pm

lol where you lost at :) I know I get confuse with api myself but after a while u get the hand of it.
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Postby GODFATHER-GM_01 » Wed Nov 08, 2006 11:37 pm

every were im lost :? what can i use thats ez?
Image
User avatar
GODFATHER-GM_01
Forum Moderator
Forum Moderator
 
Posts: 221
Joined: Tue Jul 11, 2006 1:02 am
Location: GYPSY MOBB

Postby Ghost » Thu Nov 09, 2006 1:46 am

DUDE! THIS IS THE EASIEST f****ng THING EVER MAN! IT DOESN'T GET MORE SIMPLE THAN THIS! pat or jks writes the code for you, anything else, you would have to write it yourself... go download Spy++ or something and see how that makes this look like nothing...
Ghost
 

Postby ii Rocky ii » Thu Nov 09, 2006 6:31 am

i think loco explain it so nicely
The Rock, KaTiL
User avatar
ii Rocky ii
imFiles Junior
imFiles Junior
 
Posts: 86
Joined: Mon Oct 02, 2006 2:50 pm
Location: I will fuck the paltalk soon

Re: Using JK's API SPY

Postby NinjaCoder » Fri Nov 10, 2006 10:22 pm

locohacker wrote: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)


um...loco....im confused here.....i tried all diff things....n i dont get that code u posted.....can u please show a picture of that so i can see exactly wut ur talkin bout....cus i put it on the border of da room n i got diff code... :?
NinjaCoder
 

Postby Ghost » Fri Nov 10, 2006 11:00 pm

I'm assuming that this tut was to send text to a room...

If it was, then the reason you're getting something different, YeaAnd, is because you dragged it to the border of the window, which was retarded. You're setting the windows text, meaning you have to drag the ring to where you would usually type, not the border of the window... Its impossible to type on the border of a window...
Ghost
 

Postby locohacker » Sat Nov 11, 2006 8:05 am

YeaAnd, I see what your doing okie yes you need to do that too to get the main window, but you also need to get the api of the textbox, then you put it together :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Postby Ghost » Sat Nov 11, 2006 8:23 am

actually, loco, it sounds like you found the window and then did DO EVENTS, right? because if you did, theres no reason to... all you really have to do is find the text area that you want to set the text for... so api'ing the window's border is obsolete...
Ghost
 

Postby NinjaCoder » Sat Nov 11, 2006 9:49 am

OK im confused now....Loco says one thing and Ghost says another thing...wuts the best way.... :?:
NinjaCoder
 

Next

Return to Programming Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests