|
-
Mar 27th, 2001, 02:30 PM
#1
Thread Starter
New Member
How can i use vb to send information to a java window in ie without using api
-
Mar 27th, 2001, 02:47 PM
#2
Frenzied Member
I don't think it's going to be easy....the easiest way to send messages to other programs, is to use the FindWindow API to find the program you want to send messages to, and then you the SendMessage API to send the actual message.
-
Mar 27th, 2001, 02:56 PM
#3
Thread Starter
New Member
Ok then that means I need to figure this api thing out.
I'm told to use spy ++ to find the api thingy but when
I do I see so many things I don't know which is what I need
wanna fill me in?
-
Mar 27th, 2001, 04:34 PM
#4
Frenzied Member
Use Spy++ to find the exact name of the window you want to send messages to, then use the FindWindow and SendMessage API.
I have indcluded a small sample that can control WinAmp:
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName 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
Const WM_KEYDOWN = &H100
Private Sub Command1_Click()
Dim hWinamp As Long
'Get the hWnd of Winamp
hWinamp = FindWindow("Winamp v1.x", vbNullString)
'Send the X button to Winamp
SendMessage hWinamp, WM_KEYDOWN, vbKeyZ, 0
End Sub
-
Mar 27th, 2001, 09:00 PM
#5
Thread Starter
New Member
OK
question for you mr. helpful
'Get the hWnd of Winamp
hWinamp = FindWindow("Winamp v1.x", vbNullString)
what is the winamp v1.x and what is its significance cause it works even though im usin winamp2.5 so i that just destroys any remote clue I had about that part
-
Mar 27th, 2001, 09:34 PM
#6
Thread Starter
New Member
ok i think i understand that where "winamp v1.x" i would put IEFrame if i wanted to do it to internet explorer? I'm tryin multiple programs and the only one it will even work for is winamp (im just changin the winamp v1.x to whatever is in its place for that diff program)
WELL i put ieframe since that was class name but no i dont know cause i wanna be able to send text to that address box but i dont know if someon could please tell me what to put i would greatly appreciate it
Last edited by Pibble; Mar 27th, 2001 at 10:57 PM.
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
|