How to put .bmp file to .cur file in VS

BitSmithy 2,206 Reputation points
2023-11-20T16:29:28.9766667+00:00

Hello,

I am traing to make a custom cursor for my UWP app.

I created a dll project in c++, and next added curor file to the project.

I opened this cursor file in Visual Studio inbuild editor.

But this VS editor is very poor and dificult to use. I want to make my cursor in Paint (or something similiar) and next put (copy/paste, import, etc) bitmap tu vs cursor file.

How can I do such operation.

Developer technologies | Universal Windows Platform (UWP)
Developer technologies | C++
Developer technologies | Visual Studio | Other
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2023-11-21T15:02:07.4133333+00:00

    Use any graphic tool to create/edit cursors

    I use MicroAngelo, but there are dozens

    Then you create a resource DLL in VC++, you add your cursor with a resource ID, generate the .res,

    add the .res to UWP project in .csproj :

     <Win32Resource>DLL_Resources.res</Win32Resource>
    

    then you can use it with the resource ID :

     Window.Current.CoreWindow.PointerCursor =
         new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Custom, 101);
    

    Test with a red cross :

    CustomCursor

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.