Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch .jar file from C++ WITHOUT console window

Tags:

c++

jar

When I launch .jar file like:

#include <windows.h>

using namespace std;

int main() {

    system("start javaw -splash:someImage.png -jar someFile.jar");

    return 0;
}

Also I have defined -mwindows option in g++ compiler.

Before splash screen - a black console shows for a few millisecods. Is there any solution to avoid that?

like image 825
Ernestas Gruodis Avatar asked Mar 21 '14 07:03

Ernestas Gruodis


1 Answers

Use this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

There's a flag CREATE_NO_WINDOW, pass Your command as parameters.

like image 149
Maciej Lichoń Avatar answered Sep 28 '22 02:09

Maciej Lichoń