|
-
July 23rd, 2006, 01:08 AM
#10
Re: Simulate Mouse Click
=/
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr wParam,
IntPtr lParam);
public const int WM_NCLBUTTONDOWN =0x00A1;
public const int WM_NCLBUTTONUP = 0x00A2;
private void button1_Click(object sender, EventArgs e)
{
Win32APICall.SendMessage(Web.Handle, Win32APICall.WM_NCLBUTTONDOWN, 544, 472);
Win32APICall.SendMessage(Web.Handle, Win32APICall.WM_NCLBUTTONUP, 544, 472);
}
So this is what I came out to now. Web being the name of the WebBrowser. Not sure if, 'WM_LBUTTONDOWN' is different from, 'WM_NCLBUTTONDOWN'. I checked around for a number that it would be, but couldn't find any. I've got an error when trying to run it, "Cannot convert from 'int' to 'System.UIntPtr'," and, "Cannot convert form 'int' to 'System.IntPtr'." I've got one of both of these for both the SendMessages. Any ideas?
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
|