What does Windows error code 1402 (ERROR_INVALID_CURSOR_HANDLE) mean?

 
Previous Next
ERROR_INVALID_MENU_HANDLE ERROR_INVALID_ACCEL_HANDLE

ERROR_INVALID_CURSOR_HANDLE

The HCURSOR does not identify a cursor

A cursor is a USER32 resource referenced through HCURSOR. This error points to the handle object supplied to a cursor-related operation, not to the current pointer position or a failure to load a file path.

Cursor ownership matters during cleanup. System cursors loaded with shared semantics are managed differently from cursors created by the application. Bugs often appear when generic resource wrappers destroy a shared handle, use a handle after replacing a cursor resource, or confuse HCURSOR and HICON because both are handle-sized opaque values.

What to check

  • Keep the loader or creator call and its ownership rule with the handle.
  • Check whether cleanup ran before a delayed SetCursor or class update.
  • Avoid using a generic integer or a handle of another GUI resource type.
  • When the cursor comes from a window class, inspect class registration and class lifetime as well.

A missing cursor resource is a load-time problem; this status is specifically about a handle presented as a cursor object.

References


Looking for a different code? Search another status or error code.