ArrowHourglass mouse cursor?

Hi all,

Looking for a replacement for the VB6 code:

Screen.MousePointer = vbArrowHourglass

In Xojo, there is System.Cursors.Wait, but there doesn’t seem to be a way to switch to the Windows ArrowHourglass cursor. I don’t think such a cursor exists on Mac which might be why it’s missing, but I don’t want to embed my own mouse cursor graphic in there since the system one varies based on Windows version and theme.

The hourglass was the wait cursor in older versions of Windows. In Windows 11 it is now the blue circle.

The system “wait” cursor that is used when a long operation is in progress

Me.MouseCursor = System.Cursors.Wait

I just looked at Windows 32 documentation to see if a declare would be possible. The previous LoadCursorA function has been superseded by LoadImage.

In other words, Microsoft itself now advises to use pictures. It will probably be way easier to use Xojo built in functions to display the hourglass.

You can find many Windows hourglass pictures here:

Thanks for the reply, but the ArrowHourglass is an animated cursor, not a bitmap. On Windows 10 (I haven’t upgraded to 11 yet so I can’t speak to that) it’s the arrow with the blue spinner at the top right, which is animated. And it’s been animated ever since Windows Vista I believe.

Here’s what it looks like on Win10 for reference. Sorry for the crappy phone recording but screen capture software doesn’t capture the mouse cursor, it saves the position and draws it in later so it’s representation of the mouse is unreliable.

Exactly, the blue circle has replaced the hourglass, now.

Have you tried the Wait cursor I posted above ?

Yes, but the System.Cursors.Wait cursor replaces the entire mouse with the blue spinner, it has no arrow next to it. It’s a different cursor for a different situation.

The cursor with the arrow attached indicates to the user that the mouse is still functional, they can still click the cancel button for example. We developers know you can still click the cancel button while the cursor is System.Cursors.Wait but not only is it not obvious to the user, they also have to guess where the hotspot of the mouse is on the wait cursor.

vbArrowHourglass, despite “hourglass” being in the name, was just an enum that loaded the correct cursor. In .NET it’s Cursors.AppStarting while Xojo’s System.Cursors.Wait is equivalent to .Net’s Cursors.WaitCursor.

Here’s all the cursors that .Net enumerates, you can see the difference between .AppStarting and .WaitCursor:


Xojo doesn’t seem to have an equivalent cursor for Cursors.AppStarting (or vbArrowHourglass as it was called in VB6).

The path to the .ani file that contains the cursor for the currently active theme is in HKEY_CURRENT_USER\Control Panel\Cursors\AppStarting

However from there I can’t figure out how to load that into Xojo as it is expecting a bitmap cursor.

Check LoadCursorA. That is the basis for a declare that will call the Windows system.

IDC_WAIT is supposed to display the hourglass. Under Windows 10 and 11 it may display the cursor plus blue wait circle.

To build the declare, you can get the excellent book from @Eugene_Dakin :

Picture can get a Picture array
Constructor width As Integer, height As Integer, bitmaps() As Picture

and MouseCursor Constructor a picture

Been working on this for two days now, and nothing I tried gets it to work.

I did end up picking up @Eugene_Dakin 's Declares book and it’s fantastic. He points out:

It is not recommended to use … API declares for setting the cursor … Xojo calls SetCursor often, so declares will only change the mouse for an instant and will then return to its normal state… The solution is to use the built-in Xojo MouseCursor class.

And I think this is what I’m running into because my declares should be working. Perhaps my attempts are actually successful but the Xojo framework resets the mouse cursor before I can even see it. I was able to get it to work successfully on a new window, created with CreateWindowEx, that is not managed by the Xojo framework. But at that point I might as well use C++ instead of Xojo.

As @MarkusR pointed out, a picture array might be one approach, but I can’t figure out how to parse the individual frames out of an .ANI file.

i would use an online converter or paint tool and images as static app ressource.
or delayed switch between pointer and wait if mouse is on same place, means not move.

The cursor varies between Windows versions, and from theme to theme, so it’s best to read the .cur or .ani dynamically from the registry.

and what if windows 12 not have your file,renamed it, change the format, or you app is 100% sandbox?
windows 11 ■■■■■■ up everything … mouse look is the least of my worries.

Thanks for the links, will look into them.

I agree this is not ideal, I created a feedback case to get Xojo to add the cursor to the Cursors type. It literally would be the exact same code as the Wait cursor except they’d send 32650 to the LoadCursorW function instead of 32514.

I can’t worry about what future versions of Windows will bring - When a new OS breaks something, we patch the software, that’s how it’s always worked. But the reason the mouse cursor is important is:


How does the user know they can click the cancel button here? And where is the hotspot of the mouse? Is it in the top left? Center? Everything is a guess from the user’s perspective. The solution is already built into the Windows API, we just can’t access it from a Xojo window.

Appreciate the help though, cheers and best of luck with your projects on Win11. I’ve had some frustrations with the OS as well (which is why I haven’t upgraded my personal system yet).

Open a feature request in Xojo Issues.

How does the user know they can click the cancel button here?
the area of popup where the user get information that he must wait get the wait cursor.
if the user move the mouse over other ui he could get this default pointer.

you would use a progress bar or progress wheel and let the mouse a arrow if your app is accessible.


1 Like

What exactly you can’t do ?
a. Change the cursor
b. Create a custom cursor
c. Create an animated cursor

Look this screen shot:

This project allow the user to change the ListBox MouseCursor, using one of the System.Cursors OR Custom.

What is Custom in this context ?
The code takes the Clipboard available Picture and convert it as a cursor (I made a copy of  and get that as a cursor (RAW Cursor, whith white background since it was only to recall how this project worked).

Of course, this MouseCursor change when the Mouse is ut of the ListBox.

I do not tried to create a multiple Picture object, so I do not know if this work.

I wrote that on January 22nd, 2022, and run it now with Xojo 2022r2 (m1 MacBookPro / Monterey 12.5). The code is some lines only (including tests)… but warning: you can pass a large image asa MouseCursor (on macOS, not tested on WIndows) by error, so limit the picture size.

Case "Custom"
  Dim Clip As New Clipboard
  Dim Curs_Pict As New Picture(40,40)
  If Clip.PictureAvailable Then
    Curs_Pict = Clip.Picture
    Dim thisMouse As New MouseCursor(Curs_Pict, 0, 0)
    Me.MouseCursor = thisMouse
  End If

Remember: in my code above, I use a ScreenShot I’ve done before I click in Custom (last line of the first screen shot above).

Thus my question above: what do not worked for you ?

Read the thread.

I do that many times…