#780 banish msdos window please help

baeltazor Wed 14 Oct 2009

can somebody please help me get rid of this msdos window please? everytime i open my fwt application the msdos command prompt still appears how can i get rid of it???

brian Wed 14 Oct 2009

did you try javaw.exe?

baeltazor Wed 14 Oct 2009

i did find that javaw.exe file inside my java program directory but i have no idea what to do with it , i'm sorry, can you please explain what i should do with that file?

brian Wed 14 Oct 2009

Per my earlier post, follow instructions in setup to launch your Fan application directly with java.exe. Something like:

java -cp c:\dev\fan\lib\java\sys.jar -Dfan.home=%fan_home% fanx.tools.Fan myPod::Main

Assuming you can get that to work, change over to use javaw.exe. Do a google search to see how javaw works - there is lots of information out there.

baeltazor Wed 14 Oct 2009

i tried the above, and in the console window i got a java.lang.ExceptionInitializerError error. i also searched on google, but couldn't find anything that has helped. ill keep searching..........

brian Wed 14 Oct 2009

I just tried it and works fine (except you get a DOS window flash momentarily).

This is what my batch file looks like:

set fan_home=c:\dev\fan
start javaw.exe -cp %fan_home%\lib\java\sys.jar;%fan_home%\lib\java\ext\win\swt.jar fanx.tools.Fan flux

baeltazor Wed 14 Oct 2009

i just typed that in, the only thing that happened was that Flux opened. but it hasn't changed anything, when i open any of the apps i've created, the msdos window is still displayed until i exit the programs... it even shows up when i run any of the apps in the examples directory.

brian Wed 14 Oct 2009

you to use that code in a batch file, then double click the batch file (that is how I tested it)

obviously you need to replace flux with whatever your application's main is

KevinKelley Wed 14 Oct 2009

(except you get a DOS window flash momentarily)

...and (in XP anyway) if you make a shortcut to that batch file Brian describes, alt-enter for properties of the shortcut, change "Run: normal window" to "Run: minimized" then the dos box doesn't flash. The Fan FWT app you're starting will run normally; this setting only applies to the launcher box.

baeltazor Thu 15 Oct 2009

thank you Brian, and KevinKelly for your help :)

I wonder if it's possible to somehow include the code in that batch file inside my actual program itself so that I don't need to have two files all the time?

JohnDG Thu 15 Oct 2009

Welcome to tech support hell. :)

baeltazor Thu 15 Oct 2009

lol thanks. :P

these guys are awesome :D

tompalmer Sat 17 Oct 2009

The command window is an annoying feature of Windows. An exe either will or won't show the command window, depending on metadata in the exe. (I don't know the details. Just this is how I've observed it to work.)

That's why you need different exes for whether or not you want to see the command window (java.exe vs. javaw.exe).

Saying which is best as a default is somewhat tricky. Perhaps javaw, since you can always run manually from a command prompt to get stdout if you are a developer or want that kind of interface.

So, at the moment, I'd vote switching to javaw and console-less exes generally across Fan for Windows. But maybe I'm overlooking use cases.

A one-click (or scriptable) exe generator would be sweet. I've long said various import/export features would be killer in the post 1.0 phase, at some point.

KevinKelley Sat 17 Oct 2009

different exes

I'm thinking it'd make sense to have fan.exe as now, and a fanw.exe which would be targeted as windows, no console.

Adding /link -subsystem:windows to the end of the appropriate line in /src/launcher/build.bat:

%compile% /DFAN_TOOL="\"Fan\""   /Fe%fan_home%\bin\fanw.exe  /link -subsystem:windows

targets a no-console Windows executable, but we need a WinMain function for an entry point. I haven't been here since windows95 came out.

baeltazor Tue 20 Oct 2009

thats a very good and interesting idea :)

Login or Signup to reply.