Results 1 to 4 of 4

Thread: clicking inside an webbrowsercontrol

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    9

    Question clicking inside an webbrowsercontrol

    i've got a form containing a webbrowser control, visiting a page containing a flash game, this is what i want to do:
    i want to send a click with PostMessage clicking inside the webbrowser @ somewhere(X,Y) on the flash game? anyone got an idea?

    i've tried to use "PAT or JK's API SPY" to get the handle of the webbrowser, got a few diffrent handles, tried them all no success =( (copied and pasted

    Dim thunderformdc As Long, shellembedding As Long, shelldocobjectview As Long
    Dim internetexplorerserver As Long, shockwaveb As Long, imlwincls As Long
    thunderformdc = FindWindow("thunderformdc", vbNullString)
    shellembedding = FindWindowEx(thunderformdc, 0&, "shell embedding", vbNullString)
    shelldocobjectview = FindWindowEx(shellembedding, 0&, "shell docobject view", vbNullString)
    internetexplorerserver = FindWindowEx(shelldocobjectview, 0&, "internet explorer_server", vbNullString)
    shockwaveb = FindWindowEx(internetexplorerserver, 0&, "shockwave_8.5.0.324:0b967438", vbNullString)
    imlwincls = FindWindowEx(shockwaveb, 0&, "imlwincls", vbNullString)
    imlwincls = FindWindowEx(imlwincls, 0&, "imlwincls", vbNullString)
    imlwincls = FindWindowEx(imlwincls, 0&, "imlwincls", vbNullString)

    i also use this code:

    Public Function MakeWord(ByVal LoWord As Integer, ByVal HiWord As Integer) As Long
    MakeWord = (HiWord * &H10000) + (LoWord And &HFFFF&)
    End Function

    'example trying with thunderformdc :\.. not working even though
    ' i've resized the webbrowsercontrol to cover the whole form :\
    dword = MakeWord(X,Y)
    Call PostMessage(thunderformdc, WM_LBUTTONDOWN, 0&, dword)
    Call PostMessage(thunderformdc, WM_LBUTTONUP, 0&, dword)

    Thanks! Help Is Heavily Appreciated!

  2. #2
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    The Netherlands
    Posts
    403
    Use APi function:

    VB Code:
    1. Private Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

    This will send a mouseclick on a target x,y pos. Your browser has to be ontop of all forms.
    There are 10 types of people, those who understand binary and those who don't

    http://merlijn.beyonix.net

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    9

    :\

    i would prefer if the form didn't need to be ontop i would like to see your solution as the last one :\

    thanks for using your time answering my questions

  4. #4
    Fanatic Member alexandros's Avatar
    Join Date
    Oct 2002
    Location
    Milky Way Galaxy
    Posts
    694
    Public Declare Function GetFocus Lib "user32" () As Long
    webbrowser.SetFocus
    wbhwnd = GetFocus

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