Background app without window


#1

Hi all !

Nice new website by the way.
I’m trying to spawn a background juce process from a main juce app.

Basically, everything works, I got the IPC right and stuff.

The only thing is that I would like my child process not to have a window at all. No matter what I do, it always create a default window.

Under windows, I tryied using SUBSYSTEM:WINDOWS (SUBSYSTEM:CONSOLE always creates a console window).
By digging into juce code, I found that

bool Process::openDocument (const String& fileName, const String& parameters) { HINSTANCE hInstance = 0; JUCE_TRY { hInstance = ShellExecute (0, 0, fileName.toWideCharPointer(), parameters.toWideCharPointer(), 0, SW_SHOWDEFAULT); } JUCE_CATCH_ALL return hInstance > (HINSTANCE) 32; }

I tried most of the valid values for ‘SW_SHOWDEFAULT’ but it doesn’t change anything.

Is it possible at all with juce ? What do I do wrong ? Normally SUBSYSTEM:WINDOWS doesn’t create any window by default but let’s the user do it. Any hint would be welcome


#2

Just make your process a windows app rather than a command-line app, and don’t create any windows… (??)


#3

Hey

The process you want to run in the background you can write the process as a different class which publically inherites thread and has a listener method in it and create a variable of that class in your main juce application . You can use that in main juce app whenever you require it and can even see the results of it with the listener whose output you can view on the a component inheriting textEditor . Hope it helps :slight_smile:

//saagn