C # Get the system the current mouse pattern code is as follows:
Using System.Runtime.InteropServices; [StructLayout (layoutkind.sequential)]struct cursorinfo{public int cbsize; public int flags; Public IntPtr hcursor; public point Ptscreenpos;} [DllImport ("user32.dll")]static extern bool Getcursorinfo (out Cursorinfo PCI); Private Const int cursor_showing= 0x00000001; private void Button1_Click (object sender, EventArgs e) { cursorinfo vcurosrinfo; Vcurosrinfo.cbsize = Marshal.SizeOf (typeof (Cursorinfo)); Getcursorinfo (out vcurosrinfo); if ((Vcurosrinfo.flags & cursor_showing)! = cursor_showing) return; Cursor vcursor = new cursor (vcurosrinfo.hcursor); Graphics vgraphics = Graphics.fromhwnd (Handle); Rectangle vrectangle = new Rectangle (0, 0, +, +); Vgraphics.fillrectangle (New SolidBrush (BackColor), vrectangle); Vcursor.draw (Vgraphics, vrectangle);}