Always on top

hiya :smiley:

is there a way to get a JUCE program to stay ‘always on top’ in windows?

I didn’t try it, but it looks like the following might work:

  1. get a pointer to the NativeDesktopWindow for the Component that is your main window:
    pndw = mainWindow->getWindowFor (const Component *const component);

  2. call pndw->setAlwaysOnTop (1) ;

“NativeDesktopWindow objects are created and managed internally by the Component class when it needs to put itself on the desktop, and applications should rarely need to use this class.”

whats wrong with void Component:: setAlwaysOnTop (const bool shouldStayOnTop) ?

There was a bug in previous JUCE version but I think it was fixed

Yes, use the Component::setAlwaysOnTop() method - only qualified experts should use NativeDesktopWindow.