-
August 27th, 2000, 09:07 PM
#1
WM_LBUTTONDOWN and SendMessage
Hi,
I am trying to simulate a click at a certain point in a webbrowser control. I found its handle but i can't format the lparam of WM_LBUTTONDOWN/UP so that it clicks in the correct position. Can someone tell me how to format the lparam so that (for example) X=32 and Y=32. Also, i only want to use sendmessage, not mouse_event.
Thanks in advance!
Iouri Boutchkine
iboutchkine@hotmail.com
-
August 28th, 2000, 01:12 AM
#2
Re: WM_LBUTTONDOWN and SendMessage
you can try the MAkeDWord function, that I have "found" on the web (may be even in this forum? I don't remember).
private Function MakeDWord(wHi as Integer, wLo as Integer) as Long
If wHi And &H8000& then
MakeDWord = (((wHi And &H7FFF&) * 65536) Or (wLo And &HFFFF&)) Or &H80000000
else
MakeDWord = (wHi * 65535) + wLo
End If
End Function
lparam = Makedword...
>Also, i only want to use sendmessage, not mouse_event.
Any reason for that?
MS WANTS you to use mouse_event, or better yet, SendInput.
-
August 28th, 2000, 01:28 PM
#3
Re: WM_LBUTTONDOWN and SendMessage
Hi,
Thanks for your code, however, only part of it works. the loword comes out to zero, when inserted into the PostMessage function. so X32 Y32 (X=loword, Y=hiword) come out like X0 Y32. Can you look at it again and find, what, if anything, is wrong? I appreciate your help.
Thanks!
Iouri Boutchkine
iboutchkine@hotmail.com
-
August 29th, 2000, 01:25 AM
#4
Re: WM_LBUTTONDOWN and SendMessage
wanna try this one? from MSDN?
Function MakeDWord(LoWord as Integer, HiWord as Integer) as Long
MakeDWord = (HiWord * &H10000) Or (LoWord And &HFFFF&)
End Function
untested!
-
August 29th, 2000, 09:26 AM
#5
Re: WM_LBUTTONDOWN and SendMessage
Hi, I waste a lot of time for emulating mouse event with webbrowser control.
And no result yet.
I can't send message (with API and right coord) to control becouse I can't define Hwnd for browser.
And now I decide use IE object model. But there is another problem.
At first, my task.
Implement feature that allow users browser thought html doc by mousedouwn event. You press mouse button on some link and browser go to the link while you pressing mouse button.
I try to use WebBrowser.Document property that has event onmousedown, but when I get
set doc = WebBrowser.Document
doc.ActiveElement has [object] (as I see it's pointer on document object), after next mousedown or mouseup events doc.ActiveElement has current URL (that exact what I need). Focus changed from [object] to link.
So, how can I reach URL on _First_ mousedown (by one mouse event)?
-
December 2nd, 2003, 07:58 PM
#6
Not sure if this is what your asking, but there is a macro
LPARAM MAKELPARAM(
WORD wLow,
WORD wHigh
);
So for your case i'd do the following...
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(32,32));
- where 'hWnd' is the handle to the window
-
December 3rd, 2003, 10:02 AM
#7
Re: Re: WM_LBUTTONDOWN and SendMessage
Originally posted by Marsha Dastin
You press mouse button on some link and browser go to the link while you pressing mouse button.
umm.. browsers go to the link on museup, not mousedown...
or is that what youre trying to implement (why??)
-
December 4th, 2003, 02:13 AM
#8
Re: WM_LBUTTONDOWN and SendMessage
Originally posted by Iouri
Hi,
I am trying to simulate a click at a certain point in a webbrowser control. I found its handle but i can't format the lparam of WM_LBUTTONDOWN/UP so that it clicks in the correct position. Can someone tell me how to format the lparam so that (for example) X=32 and Y=32. Also, i only want to use sendmessage, not mouse_event.
Thanks in advance!
Iouri Boutchkine
iboutchkine@hotmail.com
Hi,
Have you tried something like this? The first WM_LBUTTONDOWN will activate the button.
Code:
PostMessage hwnd, WM_LBUTTONDOWN, 0&, CLng(&H90009)
PostMessage hwnd, WM_LBUTTONDOWN, 0&, CLng(&H90009)
PostMessage hwnd, WM_LBUTTONUP, 0&, CLng(&H90009)
Or take a look at this link http://www.codeguru.com/forum/showth...hreadid=271953
Busy
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
|