This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Disable shell window on win32 when running external command line programs
- From: fernando at lozano dot eti dot br
- To: Ranjit Mathew <rmathew at hotmail dot com>, java at gcc dot gnu dot org
- Date: Mon, 09 Jun 2003 22:52:10 GMT
- Subject: Re: Disable shell window on win32 when running external command line programs
- Reply-to: fernando at lozano dot eti dot br
Hi Ramjit,
On some compilers (like Free Pascal which also uses GNU binutils from Mingw)
that's a matter of adding a link-time switch. Isn't there one we can use on
GCJ, so the user can generate an .EXE header for a console or a windowed app?
[]s, Fernando Lozano
> > as up to now I was (due to this mailinglist) able to disable gcj-swt-apps
> > showing a console window when started using -mwindows at link-time
> >
> > but if I now start an external command line program (in this case cdrecord)
> > using
> >
> > Runtime.getRuntime().exec("cdrecord --scanbus");
> >
> > there pops up a command line window - which is not the case when using the sun
> > jre
>
> This problem is also there for a GUI application when it
> encounters an exception (as GCJ spawns addr2line and c++filt).
>
>
> > How can I disable this?
>
> I'm not 100% sure, but quite possibly, modifying the
> CreateProcess( ) call in java/lang/natWin32Process.cc
> like the following should help:
>
> if (CreateProcess (NULL,
> cmdLine,
> NULL,
> NULL,
> 1,
> - 0,
> + CREATE_NO_WINDOW,
> env,
> wdir,
> &si,
> π) == 0)
>
> However, it seems that this would not work on Win9x/ME
> and for 16-bit MSDOS apps (according to MSDN).
>
> Ranjit.
>
> --
> Ranjit Mathew Email: rmathew AT hotmail DOT com
>
> Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/
>
>