• Welcome to Valhalla Legends Archive.
 

[C#] Moving the mouse?

Started by Insolence, August 14, 2005, 03:37 AM

Previous topic - Next topic

Insolence

Having a hell of a time simply moving the mouse, here's what I got so far:
    [DllImport("user32.dll")]
    public extern static int SendMessage( IntPtr hwnd, uint msg, uint wParam, long lParam);

User32.SendMessage(this.Handle, (int)WM.MOUSEMOVE, 0, MakeLong ( PixelRect[i,0], PixelRect[i,1] ) );

WM.MOUSEDOWN = 0x0200 like it should, I can't think of any other things to check.  I've changed the import castings (is that what you'd call it?) many times... not sure what else I can do =\

TehUser

WM_MOUSEMOVE is the notification windows get when the mouse has moved.  As far as I know, it doesn't actually move the cursor.  What you want is SetCursorPos.

Insolence

That seems to be working, thanks a ton :)