Java development: GUIs

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
See topic. And yes, I know we have a "Software" forum, but I don't think you could find a programmer there if you waved around a naked girl with assembly tatooed on her boobies.
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
you could write a small program in c/c++ to start the application without showing the console window
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: dighn
you could write a small program in c/c++ to start the application without showing the console window

I don't hang with the C/C++ crowd. If you have some sample code, though, it could make a nice temporary fix (had a data entry person axe the console window and lose 3 hours of work on Friday)
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
The Software forum is FULL of programmers that have been begging for years to have the forum split into a Programming forum, and a Games and Apps forum, so that they didn't have to look through yet another Counterstrike or Firefox thread to get to the programming topics. If you can't find anyone there who can help with this ridiculously simple problem, I doubt you're going to be able to figure out how to write any useful code anyway.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: dighn
Originally posted by: EyeMWing
Originally posted by: dighn
you could write a small program in c/c++ to start the application without showing the console window

I don't hang with the C/C++ crowd. If you have some sample code, though, it could make a nice temporary fix (had a data entry person axe the console window and lose 3 hours of work on Friday)



#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

i could compile a small program for you if you give me the parameters etc

Nah, we still have some C++ goodies scattered about from the transition to Java.
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Edit: Okay, I'll eat that. I was looking at the DOS prompt and confusing it with the console window. Problem being that 95% of our executions are from batch files.

I now feel a total redesign coming on...
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
Originally posted by: EyeMWing

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

i just made a shortcut with javaw and it works fine here. this is pretty handy heh :) no console window.

the exe starter also works though.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: dighn
Originally posted by: EyeMWing

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

i just made a shortcut with javaw and it works fine here. this is pretty handy heh :) no console window.

the exe starter also works though.

:thumbsup:
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?

That's EXACTLY what's happening. It was a cheap hack to hold us over until one of us wrote narrative code, and it just kind of stuck because it worked. Well then, I guess I'd better get some sleep tonight.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?

That's EXACTLY what's happening. It was a cheap hack to hold us over until one of us wrote narrative code, and it just kind of stuck because it worked. Well then, I guess I'd better get some sleep tonight.

I'd like to offer an explanation if you don't already have one...

The batch file is executed by cmd.exe (assuming you're not running 9x or something, obviously. This would necessitate its execution, and thus your window. The difference is that a Windows app with the WinMain entry point as dighn showed will emit a GUI subsystem type in the resultant PE file header (your executable), but otherwise it's going to be CUI (console user interface); in other words, a console is always going to be launched regardless of how it's executed. Also, if you just create a shortcut to it it will be handled by shell32.dll, and this is a library with no entry point at all.

Now you know if you didn't already.
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?

That's EXACTLY what's happening. It was a cheap hack to hold us over until one of us wrote narrative code, and it just kind of stuck because it worked. Well then, I guess I'd better get some sleep tonight.

I'd like to offer an explanation if you don't already have one...

The batch file is executed by cmd.exe (assuming you're not running 9x or something, obviously. This would necessitate its execution, and thus your window. The difference is that a Windows app with the WinMain entry point as dighn showed will emit a GUI subsystem type in the resultant PE file header (your executable), but otherwise it's going to be CUI (console user interface); in other words, a console is always going to be launched regardless of how it's executed. Also, if you just create a shortcut to it it will be handled by shell32.dll, and this is a library with no entry point at all.

Now you know if you didn't already.

Yep, it dawned on me about 30 seconds after I posted. Damn you, java. Also, damn you, my evil tendencies to work out of a DOS box. Furthermore, damn you, Microsoft, for now leaving me with the neccesity of making a GDMF C/C++ program to act as a shell (this is run from a CD, thus shortcuts won't work because of the simple fact that drive letters change and there is no, and never will be, a permanent installation on the host computer)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?

That's EXACTLY what's happening. It was a cheap hack to hold us over until one of us wrote narrative code, and it just kind of stuck because it worked. Well then, I guess I'd better get some sleep tonight.

I'd like to offer an explanation if you don't already have one...

The batch file is executed by cmd.exe (assuming you're not running 9x or something, obviously. This would necessitate its execution, and thus your window. The difference is that a Windows app with the WinMain entry point as dighn showed will emit a GUI subsystem type in the resultant PE file header (your executable), but otherwise it's going to be CUI (console user interface); in other words, a console is always going to be launched regardless of how it's executed. Also, if you just create a shortcut to it it will be handled by shell32.dll, and this is a library with no entry point at all.

Now you know if you didn't already.

Yep, it dawned on me about 30 seconds after I posted. Damn you, java. Also, damn you, my evil tendencies to work out of a DOS box. Furthermore, damn you, Microsoft, for now leaving me with the neccesity of making a GDMF C/C++ program to act as a shell (this is run from a CD, thus shortcuts won't work because of the simple fact that drive letters change and there is no, and never will be, a permanent installation on the host computer)

Man, I'm going to hook you up big time tonight just because I'm nice. Do this:

cmd /C start javaw somedamnclass

Welcome.
 

EyeMWing

Banned
Jun 13, 2003
15,670
1
0
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?

That's EXACTLY what's happening. It was a cheap hack to hold us over until one of us wrote narrative code, and it just kind of stuck because it worked. Well then, I guess I'd better get some sleep tonight.

I'd like to offer an explanation if you don't already have one...

The batch file is executed by cmd.exe (assuming you're not running 9x or something, obviously. This would necessitate its execution, and thus your window. The difference is that a Windows app with the WinMain entry point as dighn showed will emit a GUI subsystem type in the resultant PE file header (your executable), but otherwise it's going to be CUI (console user interface); in other words, a console is always going to be launched regardless of how it's executed. Also, if you just create a shortcut to it it will be handled by shell32.dll, and this is a library with no entry point at all.

Now you know if you didn't already.

Yep, it dawned on me about 30 seconds after I posted. Damn you, java. Also, damn you, my evil tendencies to work out of a DOS box. Furthermore, damn you, Microsoft, for now leaving me with the neccesity of making a GDMF C/C++ program to act as a shell (this is run from a CD, thus shortcuts won't work because of the simple fact that drive letters change and there is no, and never will be, a permanent installation on the host computer)

Man, I'm going to hook you up big time tonight just because I'm nice. Do this:

cmd /C start javaw somedamnclass

Welcome.

no dice in this application, since the batch file still has to wait for completion to safely go away (the damned thing does stuff AFTER it executes the java app, namely printing (with a laser printer) some files, some FTPing, some emailing, yeah, it's a filthy mess that we should've coded properly the first time)

I still have to kill the batches at the lowest level.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: Descartes
Originally posted by: EyeMWing
Originally posted by: dighn
Originally posted by: Descartes
Originally posted by: dighn
#include <windows.h>

int CALLBACK WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
::ShellExecute(NULL, "open", "java", "parameters for java.exe here", NULL, SW_HIDE);

return 0;
}

I don't see how a stub to simply hide the window benefits much.

Again, I'm pretty certain that javaw will be useful here.

it works but i didn't know about javaw just until half a minute ago ;)

javaw still gives me the console window, and Sun doesn't document any arguments for getting rid of it (in fact, the only difference between java and javaw that I can see is that javaw spits out utterly worthless error messages, while java gives you a stack trace.

Please don't tell me you're running this from a batch file or something?

That's EXACTLY what's happening. It was a cheap hack to hold us over until one of us wrote narrative code, and it just kind of stuck because it worked. Well then, I guess I'd better get some sleep tonight.

I'd like to offer an explanation if you don't already have one...

The batch file is executed by cmd.exe (assuming you're not running 9x or something, obviously. This would necessitate its execution, and thus your window. The difference is that a Windows app with the WinMain entry point as dighn showed will emit a GUI subsystem type in the resultant PE file header (your executable), but otherwise it's going to be CUI (console user interface); in other words, a console is always going to be launched regardless of how it's executed. Also, if you just create a shortcut to it it will be handled by shell32.dll, and this is a library with no entry point at all.

Now you know if you didn't already.

Yep, it dawned on me about 30 seconds after I posted. Damn you, java. Also, damn you, my evil tendencies to work out of a DOS box. Furthermore, damn you, Microsoft, for now leaving me with the neccesity of making a GDMF C/C++ program to act as a shell (this is run from a CD, thus shortcuts won't work because of the simple fact that drive letters change and there is no, and never will be, a permanent installation on the host computer)

Man, I'm going to hook you up big time tonight just because I'm nice. Do this:

cmd /C start javaw somedamnclass

Welcome.

no dice in this application, since the batch file still has to wait for completion to safely go away (the damned thing does stuff AFTER it executes the java app, namely printing (with a laser printer) some files, some FTPing, some emailing, yeah, it's a filthy mess that we should've coded properly the first time)

Then you need to rethink all of this. The nature of a Windows application is that its execution is asynchronous; one execution is not coupled to any other as it would be in a batch file with executables operating under the CUI subsystem.

If you need to execute these operations in sequence then you want the execution to block the others. If you create the little stub in C++ with the WinMain it will exhibit the same behavior as the command I gave above. Stick with what you have...