Results 1 to 6 of 6

Thread: how can i send info to program

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    5

    Exclamation

    How can i use vb to send information to a java window in ie without using api

  2. #2
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    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.
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    5
    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?

  4. #4
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    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
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    5
    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    5
    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
  •  



Click Here to Expand Forum to Full Width