DestroyCursor function (winuser.h)

Destroys a cursor and frees any memory the cursor occupied. Do not use this function to destroy a shared cursor.

Syntax

BOOL DestroyCursor(
  HCURSOR hCursor
);

Parameters

hCursor

Type: HCURSOR

A handle to the cursor to be destroyed. The cursor must not be in use.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The DestroyCursor function destroys a nonshared cursor. Do not use this function to destroy a shared cursor. A shared cursor is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared cursor:

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See also

Conceptual

CopyCursor

CopyImage

CreateCursor

Cursors

LoadCursor

LoadCursorFromFile

LoadImage

Reference