|
-
Sep 7th, 2000, 02:25 PM
#1
Thread Starter
Hyperactive Member
my program needs to be able to read and display information that is in another app's textboxs. how do i do this?
for example:
i need to get the text out of aol instant messenger's screen (the screen that shows the converstation)
i then need to put the text in my own textbox
thanks in advance for any help!!!
-
Sep 7th, 2000, 02:40 PM
#2
Frenzied Member
use of apis
you have to read the handle of the aol form/screen using api
and you go from there
*i never have done it so i wodn't know EXACTLY how it would be* but you will be using some apis to do this
-
Sep 7th, 2000, 03:02 PM
#3
I believe this is what you want:
Code:
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 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 Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Private Sub Command1_Click()
Dim aimimessage As Long, wndateclass As Long, ateclass As Long
aimimessage = FindWindow("aim_imessage", vbNullString)
wndateclass = FindWindowEx(aimimessage, 0&, "wndate32class", vbNullString)
ateclass = FindWindowEx(wndateclass, 0&, "ate32class", vbNullString)
Dim TheText As String, TL As Long
TL = SendMessageLong(ateclass, WM_GETTEXTLENGTH, 0&, 0&)
TheText = String(TL + 1, " ")
Call SendMessageByString(ateclass, WM_GETTEXT, TL + 1, TheText)
TheText = Left(TheText, TL)
Text1.Text = TheText
End Sub
-
Sep 7th, 2000, 04:39 PM
#4
Thread Starter
Hyperactive Member
that looks good, but what if the application isnt aim?
my problem is my program is made to interface with multiple programs. it there a way to send a message box to the user every time he sets the focus on a new window and ask him if this is the window that he wants my program to interface with?
sorry if this is kindof confusing. if it is tell me and i'll try to clear it up.
thanks to everyone who replied so far.
-
Sep 7th, 2000, 08:04 PM
#5
Thread Starter
Hyperactive Member
to Matthew Gates (or anyone who knows):
in this line of the code you gave me:
Code:
aimimessage = FindWindow("aim_imessage", vbNullString)
how did you come up with: "aim_imessage" (in quotes)
how do you know automatically what name it goes by?
[Edited by HAVocINCARNATE29 on 09-07-2000 at 09:14 PM]
-
Sep 8th, 2000, 02:23 PM
#6
Monday Morning Lunatic
You use a spy program such as Spy++. I can email you VB source to one if you want.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 8th, 2000, 02:36 PM
#7
aim_imessage is the class.
I used PatorJK's Api Spy 5.0 to get the class. There's also an option to get a windows text on there.
-
Sep 8th, 2000, 02:42 PM
#8
Frenzied Member
Or you could switch it:
Code:
aimimessage = FindWindow(vbNullString, "Notepad")
'to find it with the windowtitle.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 8th, 2000, 10:32 PM
#9
Thread Starter
Hyperactive Member
first,parksie please send me that source.
second:
now i know whet i need to do. 1 question first.
is there an api call to get the class of the window that has the focus?
-
Oct 18th, 2001, 10:11 PM
#10
Hyperactive Member
how could i do what that does but with mirc ?
-
Dec 26th, 2001, 12:30 PM
#11
Frenzied Member
i know this is an old question... but....
okay, i got the code to work, but it only tracks one window... how can i make it loop through all the open AIM windows??
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|