# Standalone JUCE program start (SOLVED)

**URL:** <https://forum.juce.com/t/standalone-juce-program-start-solved/16874>\
**Category:** General JUCE discussion\
**Created:** [March 6, 2016, 2:15pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874 "2016-03-06T14:15:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [March 6, 2016, 2:15pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/1 "2016-03-06T14:15:48Z")

</div>

I've noticed strange thing with JUCE standalone programs on Windows&nbsp;(JUCE demo for example) - JUCE versions 3.1 and 3.2.&nbsp;

I can reproduce it with my standalone app&nbsp;as well.

When program starts, it doesn't display its window at the top of other windows&nbsp;. Instead, its&nbsp;blinking icon appears&nbsp;in the status line. Click on the icon puts the&nbsp;window to the front&nbsp;and program works normally. Like program would be put in the background when started ?!?

In very rare cases program starts normally, but icon is blinking nevertheless - setting Shortcut's "Run" option&nbsp;has no effect on this behaviour.

Windows 7 x64 here.

Any ideas?

Thx!

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [March 6, 2016, 5:10pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/2 "2016-03-06T17:10:17Z")

</div>

Have you tried this with juce 4.1?

There are documentWindow methods that can move an application window to the front

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [March 6, 2016, 6:13pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/3 "2016-03-06T18:13:23Z")

</div>

I'll try with 4.1 as well.

Strangely, JUCE Plugin Host doesn't suffer from this issue - can't tell why - it is also based on Document window and main window code looks pretty much the same as in JUCE demo or my app.

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [March 6, 2016, 6:17pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/4 "2016-03-06T18:17:45Z")

</div>

“Pretty much the same” isnt “exactly the same” tho. I’d compare it line by line with your code.

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [March 7, 2016, 10:59am UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/5 "2016-03-07T10:59:00Z")

</div>

I've just check all possible code differences (regarding startup and main window creation) between my JUCE standalone app / JUCE demo and JUCE Plugin Host.

Just can't find what could be the reason for Plugin Host to work correctly and others don't. Plugin host main window is always displayed at the&nbsp;top when program is started. My program and JUCE Demo are displayed in the background.

Anyone ?

Thanks!

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [March 8, 2016, 11:57am UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/6 "2016-03-08T11:57:08Z")

</div>

I finally found the reason for this misbehaviour!

I had&nbsp;the following code inside main DocumentWindow constructor ...

```
setUsingNativeTitleBar (true);
```

Now, I've moved it to&nbsp;application'a Initialise function and suddenly everything works as expected.

```
mainWindow->setUsingNativeTitleBar (true);
```

The same solution applies to JUCE Demo program !

Any comments on this ?

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [March 8, 2016, 12:20pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/7 "2016-03-08T12:20:50Z")

</div>

only way to really know is to set some breakpoints and see what happens inside the juce\_application classes when this method is called from initialise() vs your documentWindow class

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [March 8, 2016, 2:38pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/8 "2016-03-08T14:38:50Z")

</div>

Yes, i agree, that would be logically the only way to find out exactly what's going on&nbsp;... but ... maybe someone already did this and knows the answer - that's why the forums are so useful =:) I won't dig into this any more (not enough time) since it is working now ...

---

<div class="post-metadata">

**Author:** ![Blackaddr](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Blackaddr](https://forum.juce.com/u/Blackaddr)\
**Post date:** [March 14, 2021, 12:40pm UTC](https://forum.juce.com/t/standalone-juce-program-start-solved/16874/9 "2021-03-14T12:40:31Z")

</div>

Thanks! This was a big help for me. I’ve been going nuts trying to figure out why my app was not launching in the foreground. This app was based off one a created years ago, and I also that setUsingNativeTItleBar() in the DocumentWindow contstructor. Moving it as you suggested fixed it.

I think at some point the midi example application (which I used as a starting point) had this issue and I propagated it.
