Custom Cursors in Windows

It doesnt. It was suggested by Peter because the option worked for him.
It doesn’t do PNG cursors: I never said it did.
But based on the responses here , I’m not inclined to spend any time looking into the PNG situation

The original question doesnt mention PNG.
It just says cursors don’t work on Windows, so Peter’s reply was appropriate.

Maybe this is a HiDPI thing.

This Windows project uses HiDPI with 72 and 144 dpi pictures.
http://fontmenu.com/xojo/customcursor.zip

This is what I see on Windows.

I tried with HiDPI both on an off.

Here is one of them

EDIT: Using Xojo 2016r4.1

Is there a way to convert my PNGs to XML?

Charles,

I tried the code Julian suggested worked and it looked fine on my end

I’m using Xojo 2016R3 and Windows 8.1 and 10

Its a bug in 2016r4.1 =\ sorry Charles, cant help any further.

<https://xojo.com/issue/46300>

A different version fixes the cursor corruption. The cursor still flickers though and switches between normal Windows and my custom while you move it in my Window.

No… the two formats are totally different, and produce totally different results…

The XML version is limited to Black/White images that are 16x16, while the Graphic oriented one is any size and color

Strip the code down the basics in a new project and check its working there. If it doesn’t flicker then you have a state issue in your code, probably in the MouseMove event where its fighting to set the cursor to two different states. If it does flicker, zip the whole test project including the cursor and post it, I’ll take a look when I wake up unless someone beats me to it.

[quote=378836:@Charles Fasano]This is what I see on Windows.

I tried with HiDPI both on an off.

Here is one of them

EDIT: Using Xojo 2016r4.1

Is there a way to convert my PNGs to XML?[/quote]

You seem to have applied the wrong mask to your picture.

Try the project I posted. No need to convert to XML or other complicated stuff. just have two png pictures with transparent background in an HiDPI image, and everything will work perfectly.

My project uses a 32x32 72 dpi and 64x64 144 dpi pictures.

Note that it works with larger pictures as well, so you could very well have a huge cursor if you want.

The Mask is upside down compared to the image… no idea if thats your fault or a bug, yet

Apparently it’s a bug in 2016r4.1. I tried an earlier version and it works as it should.

I forgot I originally had Mouse Events for the Window itself when I first started but I eventually switched from using a bunch of Canvas Controls to one big Canvas that had it’s own Mouse Events. Once I removed the Window Mouse Events, the Windows version stopped flickering the Cursor. Interesting how Mac OS corrected that and didn’t flicker the Cursor.

Thanks for all the help.