R
Ryan Ross
Hello,
I need some help with the SendMessage method. I've imported it into C# with
the following statement:
[DllImport("user32.dll", SetLastError=true)]
public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, long wparam,
int lparam);
and the following for sending the message:
User32.SendMessage(WindowObject_Basic_GDI_Handle, User32.WM_MOUSEMOVE,
User32.MK_LBUTTON, MakeLParam(X, Y));
and below for constructing the lparam:
private int MakeLParam(int LoWord, int HiWord)
{
//System.Diagnostics.Debug.WriteLine("LoWord: " + LoWord2(((HiWord << 16) |
(LoWord & 0xffff))));
return (int) ((HiWord << 16) | (LoWord & 0xffff));
}
Unfortunately, whenever I send a WM_MOUSEMOVE message to a window
(Notepad.exe), the lparam parameter doesn't mike it there!
Spy++ reports X and Y coordinates of 0. (Everything else makes it there ok).
Does anyone have ideas what kind or marshaling I need to do, or if I am
sending the correct data?
Thanks,
Ryan
I need some help with the SendMessage method. I've imported it into C# with
the following statement:
[DllImport("user32.dll", SetLastError=true)]
public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, long wparam,
int lparam);
and the following for sending the message:
User32.SendMessage(WindowObject_Basic_GDI_Handle, User32.WM_MOUSEMOVE,
User32.MK_LBUTTON, MakeLParam(X, Y));
and below for constructing the lparam:
private int MakeLParam(int LoWord, int HiWord)
{
//System.Diagnostics.Debug.WriteLine("LoWord: " + LoWord2(((HiWord << 16) |
(LoWord & 0xffff))));
return (int) ((HiWord << 16) | (LoWord & 0xffff));
}
Unfortunately, whenever I send a WM_MOUSEMOVE message to a window
(Notepad.exe), the lparam parameter doesn't mike it there!
Spy++ reports X and Y coordinates of 0. (Everything else makes it there ok).
Does anyone have ideas what kind or marshaling I need to do, or if I am
sending the correct data?
Thanks,
Ryan