SendMessages

Feb 18, 2009 at 9:28 AM
Hi,

I try to send messages via SendWindowMessage to the hosted control.
I tried InteropForm.Handle and InteropForm.Controls[0] with no success.

I created a rectangle overlayed over InteropForm. In the MouseDown
Event basically I do:

Point

 

p = e.GetPosition(rect);

 

 

int lParam = ((int)p.Y << 16) + (int)p.X;

 

SendMessage(webHost1.InteropForm.Controls[0].Handle, WM_LBUTTONDOWN,

IntPtr.Zero, new IntPtr(lParam));

 

SendMessage(webHost1.InteropForm.Controls[0].Handle, WM_LBUTTONUP,

IntPtr.Zero, new IntPtr(lParam));

Any suggestions?

Kind regards,
Sascha