# Hiding the mouse cursor

**URL:** <https://forum.juce.com/t/hiding-the-mouse-cursor/5923>\
**Category:** General JUCE discussion\
**Created:** [November 23, 2010, 10:21am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923 "2010-11-23T10:21:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warmonger](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@Warmonger](https://forum.juce.com/u/Warmonger)\
**Post date:** [November 23, 2010, 10:21am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/1 "2010-11-23T10:21:10Z")

</div>

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:

```auto

```

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

---

<div class="post-metadata">

**Author:** ![Warmonger](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@Warmonger](https://forum.juce.com/u/Warmonger)\
**Post date:** [November 23, 2010, 10:33am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/2 "2010-11-23T10:33:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 23, 2010, 10:41am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/3 "2010-11-23T10:41:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Warmonger](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@Warmonger](https://forum.juce.com/u/Warmonger)\
**Post date:** [November 23, 2010, 10:45am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/4 "2010-11-23T10:45:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 23, 2010, 10:58am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/5 "2010-11-23T10:58:25Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![Warmonger](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@Warmonger](https://forum.juce.com/u/Warmonger)\
**Post date:** [November 23, 2010, 11:41am UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/6 "2010-11-23T11:41:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 23, 2010, 12:01pm UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/7 "2010-11-23T12:01:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Warmonger](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@Warmonger](https://forum.juce.com/u/Warmonger)\
**Post date:** [November 23, 2010, 9:06pm UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/8 "2010-11-23T21:06:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 23, 2010, 9:10pm UTC](https://forum.juce.com/t/hiding-the-mouse-cursor/5923/9 "2010-11-23T21:10:30Z")

</div>

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