# Alwaysontop

**URL:** <https://forum.juce.com/t/alwaysontop/10558>\
**Category:** General JUCE discussion\
**Created:** [June 6, 2013, 6:13pm UTC](https://forum.juce.com/t/alwaysontop/10558 "2013-06-06T18:13:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [June 6, 2013, 6:13pm UTC](https://forum.juce.com/t/alwaysontop/10558/1 "2013-06-06T18:13:00Z")

</div>

If there are several windows with AlwaysOnTop set to true, which one shows up on top?

More specifically - I have a VST plugin (which is AlwaysOnTop), which occasionally displays a messagebox (on the desktop).

the messageBox is set to be alwaysOnTop, and I do a toFront() in the constructor.

nonetheless - it’s not on top. What am I missing here?

---

<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:** [June 7, 2013, 10:31am UTC](https://forum.juce.com/t/alwaysontop/10558/2 "2013-06-07T10:31:58Z")

</div>

> [@](#):
>
> I do a toFront() in the constructor.

Maybe the window isn’t actually on-screen at the point when you call toFront() ?

---

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [June 18, 2013, 5:49pm UTC](https://forum.juce.com/t/alwaysontop/10558/3 "2013-06-18T17:49:52Z")

</div>

I also call toFront() every time it paints though.

It works fine when not in a plugin - something about the plugin window seems to also end up bringing it to the front perhaps?

---

<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:** [June 18, 2013, 5:56pm UTC](https://forum.juce.com/t/alwaysontop/10558/4 "2013-06-18T17:56:29Z")

</div>

oh yes, in a plugin all bets are off - the host is in control there.

---

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [June 22, 2013, 5:03pm UTC](https://forum.juce.com/t/alwaysontop/10558/5 "2013-06-22T17:03:38Z")

</div>

Aha - I thought that might be the case, thanks.
