79542498

Date: 2025-03-28 22:17:18
Score: 0.5
Natty:
Report link

Just so you know for someone thats searching on this topic if you use a custom Cursor thats added with P/Invoke using IntPtr you must use the DestroyCursor(yourCustomCursorHandle) Import function from "user32" when you are finished using the custom cursor and maybe want to reinitialize it later if you want to free the unmanaged resources:


[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]  // Destroy the unmanaged IntPtr cursor
private static extern bool DestroyCursor(IntPtr hCursor);

This will free the resources from the custom .ani or .cur file.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): user32
  • Low reputation (0.5):
Posted by: Yordan Voyvode