Mouse pointer - change cursor RRS feed

  • Question

  • Hey

    Im looking at trying to add either a draw line or a custom cursor to the mouse pointer. I am working inside Inventor and what i am trying to achieve requires a visual element that Inventor doesnt provide. They do provide a method of hooking into the mouse cursor by adding a .cur. I looked online to create these manually but they are all small and what i need is more of a custom length each time its used. For example:

    I click on a drawing view and i can get the view size X & Y in CM. lets say the width is 75cm. I add 20cm for a space and would like to add a line that is 95cm to the mouse pointer with its hotspot dead center.

    Is it an option to create a .cur file from code with the line graphic at a specified length that can be used and either delete it or overwrite it each time?


    I am here to ask questions and learn from others. Cor Ligthert DO NOT REPLY TO ANY OF MY POSTS!!

    Saturday, July 4, 2020 6:25 PM

All replies

  • Cursors cannot be customized with any size (default size it 32*32, can be increased on last Windows 10 versions)

    See remarks at CreateCursor function

    Sunday, July 5, 2020 7:32 AM
  • That said, it's possible to add smaller image to a 32 * 32 cursor aligned to upper left corner, and then set the other parts of cursor transparent, to create the effect of having a smaller cursor.

    Since Windows Vista, there's ability to read PNG cursor files. You may try to create corresponding PNG image on the fly and prepend the required header as detailed in Wiki to see if it works.

    Monday, July 6, 2020 1:18 AM