|
-
Nov 10th, 2001, 09:45 AM
#1
Thread Starter
New Member
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!
-
Nov 10th, 2001, 12:13 PM
#2
Hyperactive Member
Use APi function:
VB Code:
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.
-
Nov 10th, 2001, 06:39 PM
#3
Thread Starter
New Member
:\
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
-
Apr 26th, 2003, 01:31 PM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|