Skip to main content
gamedev.net
๐Ÿ”’ Locked

[.net] C# SetCursorPosition

Started by tgraupmann Dec 22, 2004 at 4:52 AM 0 replies 7.6k views
Original Post
tgraupmann
tgraupmann
Quote:
[System.Runtime.InteropServices.DllImport("user32.dll" , EntryPoint="SetCursorPos")] internal extern static int SetCursorPos ( int x , int y ); is there a way to do this in c# without loading unsafe code? thanks
[System.Runtime.InteropServices.DllImport("user32.dll" , EntryPoint="GetCursorPos")] internal extern static bool GetCursorPos(out System.Drawing.Point lpPoint); [System.Runtime.InteropServices.DllImport("user32.dll" , EntryPoint="SetCursorPos")] internal extern static Int32 SetCursorPos(Int32 x ,Int32 y ); [System.Runtime.InteropServices.DllImport("user32.dll" , EntryPoint="ShowCursor")] internal extern static Int32 ShowCursor(bool bShow);
*News tagenigma.com is my new domain.
The Frugal Gourmet
The Frugal Gourmet
System.Windows.Forms.Cursor.Position = value;
Co-creator of Star Bandits -- a graphical Science Fiction multiplayer online game, in the style of "Trade Wars'.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.