SetCursor (user32)
Last changed: -203.62.211.6

.
Summary

C# Signature:

    [DllImport("user32.dll")]
    static extern IntPtr LoadCursorFromFile(string lpFileName);

    [DllImport("user32.dll")]
    static extern IntPtr SetCursor(IntPtr hCursor);

    [DllImport("user32.dll")]
    static extern bool SetSystemCursor(IntPtr hcur, uint id);

    private const uint OCR_NORMAL = 32512;

    static Cursor ColoredCursor;

VB Signature:

<DllImport("user32.dll")> _
Public Shared Function SetCursor(ByVal hCursor As IntPtr) As IntPtr
End Function

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Go Here For Even More!! Look at the second post.

http://social.msdn.microsoft.com/forums/en-US/winforms/thread/9ea0bf74-760f-4f40-b64c-0cf7b0a56939/

Sample Code:

//==========C# Only

//========SET WINDOWS CURSOR========================================

        IntPtr cursor = LoadCursorFromFile("example.cur");
        bool ret_val = SetSystemCursor(cursor, OCR_NORMAL);

//========SET WINDOWS CURSOR========================================

//========SET FORM CURSOR========================================

        IntPtr cursor = LoadCursorFromFile("example.cur");
        ColoredCursor = new Cursor(cursor);
        this.Cursor = ColoredCursor;

//========SET FORM CURSOR========================================

//========SET FORM CURSOR FROM IMAGE========================================

        Bitmap hh = (Bitmap)System.Drawing.Bitmap.FromFile("example.png");
        Graphics.FromImage(hh);
        IntPtr ptr = hh.GetHicon();
        Cursor c = new Cursor(ptr);
        this.Cursor = c;

//========SET FORM CURSOR FROM IMAGE========================================

Alternative Managed API:

System.Windows.Forms.Cursor.Current

Documentation
SetCursor on MSDN