Hiding the mouse cursor


#1

I’ve got some old code (originally built back in 2007, IIRC) that I’ve rebuilt using the latest version of Juce from Git. The method I used to hide the mouse cursor doesn’t seem to be working now. Sample code:

That should still be sufficient to hide the cursor, right?


#2

Forgot to mention that I’m using Win 7, 64 bit. Not sure if that matters or not, but it might.


#3

That’ll hide the cursor for that particular component… Were you expecting it to get rid of the mouse cursor from the entire screen?


#4

My app consists of 1 component, which takes up the entire screen. Not sure if it was clear or not, but this was working as expected when I originally wrote the program.


#5

Ah, sorry, looks like I must have broken that recently - try this, in juce_win32_Windowing.cpp:

[code]void MouseCursor::showInWindow (ComponentPeer*) const
{
HCURSOR c = (HCURSOR) getHandle();

if (c == 0 && cursorHandle == 0)
    c = LoadCursor (0, IDC_ARROW);

[/code]


#6

I tried that, made sure to do full rebuilds of Juce and my app, but it still didn’t work for me.


#7

Ok, I’ll take a look and sort it out…


#8

Thanks Jules. For now, I’ve just removed the cursor changing code and replaced it with direct calls to ShowCursor(), which seems to do the trick.


#9

I’ve got a fix, will check something in tomorrow.