Vlw a todos que responderam!
Na verdade eu encontrei uma solução (a minha solução, não sei se vai servir para todos)
O que fiz foi o seguinte, criei um arquivo exe ( C++ QT + Netbeans ) que chama um cmd.
O arquivo exe usa o ShellExecute.
Logo abaixo se encontra todo o código:
Arquivo Launcher.cmd:
SET JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8"
javaw -jar “client.jar”
Códigos fontes do exe:
Arquivo systemcore.h
#ifndef SYSTEM_H
#define SYSTEM_H
#include <windows.h>
#include
using namespace std;
class SystemCore
{
public:
static const INT ICONWINDOW = SHOW_ICONWINDOW;
static const INT FULLSCREEN = SHOW_FULLSCREEN;
static const INT OPENWINDOW = SHOW_OPENWINDOW;
static const INT HIDE = SW_HIDE;
static std::wstring stringTowstring(const std::string& s)
{
std::wstring ws;
ws.assign(s.begin(), s.end());
return ws;
}
static std::string wstringTostring(const std::wstring& ws)
{
std::string s;
s.assign (ws.begin(), ws.end());
return s;
}
static void execute(string& command, INT mode)
{
std::wstring open = stringTowstring("open");
LPCWSTR wopen = open.c_str();
std::wstring cmd = stringTowstring(command);
LPCWSTR wcmd = cmd.c_str();
ShellExecute(NULL,wopen,wcmd,NULL,NULL,mode);
}
};
#endif
Arquvio main:
#include <windows.h>
#include
#include <systemcore.h>
using namespace std;
/*O tipo de aplicativo deve
- ser QtApplication para
- esconder a janela do console
*/
int main(int argc, char *argv[]) {
string command = “Launcher.cmd”;
SystemCore::execute(command,SystemCore::HIDE);
return 0;
}