hide cmd

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

hide cmd

Post by kompromis »

how can i hide the cmd window
and still use
main()

//thanks
harukiblue
Posts: 49
Joined: Sun Dec 10, 2006 6:23 pm

good question

Post by harukiblue »

I was wondering this too, however through out my travels you have to be OS specific in order to do this. A.K.A. you would have to use windows library with mfc or something. which is a shame if you wanted to make a game for more then one OS. Well I guess you still can, but it is more coding setting up the app frames for every OS. :cry:
jrm
Posts: 111
Joined: Tue Dec 13, 2005 8:57 pm

Post by jrm »

What compiler and OS are you using?

JRM
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There is only one compiler (suite) and OS exposing this behavior :lol:
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

Post by kompromis »

jrm wrote:What compiler and OS are you using?

JRM
visual studio 2005 and win xp
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

#pragma comment(linker, "/subsystem:windows /entry:main")
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

Post by kompromis »

belfegor wrote:#pragma comment(linker, "/subsystem:windows /entry:main")
if i write that in the file all windows are hidden not only the cmd window
JDHunter
Posts: 17
Joined: Tue Jun 20, 2006 6:15 am
Location: Germany
Contact:

Post by JDHunter »

Hey,

change the Outputtyp from Consoleapplication to Windowsapplication.

go to you Project Propertys (right-mouse-click in the project)
on next screen there are Tabs: Application; Compile; Build....; Debug;
Change to Application, in there are a ComboBox "Output-type".
change it to Windowapplication.

(i think All this translation are not direct correct, because i have a german C#2005 Express)


i hope it helps :)
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

Post by kompromis »

JDHunter wrote:Hey,

change the Outputtyp from Consoleapplication to Windowsapplication.

go to you Project Propertys (right-mouse-click in the project)
on next screen there are Tabs: Application; Compile; Build....; Debug;
Change to Application, in there are a ComboBox "Output-type".
change it to Windowapplication.

(i think All this translation are not direct correct, because i have a german C#2005 Express)


i hope it helps :)
i couldn't find that option
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

simple

Post by Athlon_Jedi »

another kinda cheating way to do it is to run your app in full screen lol

the pragma comment should do the trick though dont know why it isnt in your case
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

bunch of coding and setup??

#ifdef
win32
int main(hinstance *windowsgayhandle)
#else
something retarded like mac or linux
#endif

blah blah blah omg that was so hard to setup and write... :roll:


guice had this crap 2 years ago... guess nobody ever looked at the source there was a lot of neat irrlicht tricks... that took me two years to compile into the crappy program that guice was...only because it had to do backflips to work properly... dot dot dot bitches
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

This does the trick for me:

Code: Select all

char filename[4096];
HWND hWnd;

	GetModuleFileName(NULL,filename+1,4094);
	hWnd=FindWindow(NULL,filename+1);
	if (!hWnd) 
	{
		filename[0]='\"';
		sprintf(filename+1+strlen(filename+1),"\"\0");
		hWnd=FindWindow(NULL,filename);
	}
	ShowWindow(hWnd,false);
However, if you create a Win32 project instead of a Win32 Console and replace main() by WinMain() you won't get the dosbox at all.
Jiang
Posts: 77
Joined: Tue Feb 20, 2007 11:03 am

Re: hide cmd

Post by Jiang »

[quote="kompromis"]how can i hide the cmd window
and still use
main()

//thanks[/quote]


Try add

/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup

to your linker option (the command line edit box).

HTH
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Check out
ftp://81.226.97.243:12350/Anonymous/3.JPG
Change to subsystem windows.

EDIT:
Opps, that address doesnt work. Check http://hem.passagen.se/pierrelemoine/asd.html instead
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

Post by kompromis »

thanks
worked fine
but at first i didnt understand were i should put it
/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
Post Reply