Make Console diseapear
Moderator: Coders of Rage
Make Console diseapear
I making a program that I need the Console window to disappear but I would still like it to be able receive input so if i pressed a key the program would quit but if i did not the program would continue to loop. I have tried FreeConsole() and selecting a Gui application in Code::Blocks build options but the program keeps on repeating and I have to restart my computer to stop it. I am also using getch() to detect if a key has been pressed because I don't want to have to press enter every time I enter a key.
Re: Make Console diseapear
ummm. i dont know about code blocks. but VS just has a compiler option to not display the console. however, you will have to have some API doing keyboard IO for you, becuase cin or gets or whatever c/c++ io will not work if the console is not there.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
Re: Make Console diseapear
Thanks for the info I guess Ill have to wait until I am ready to learn SDL for this program.
Re: Make Console diseapear
if you tell me what you are planning i can advice you on how to procedeherby490 wrote:Thanks for the info I guess Ill have to wait until I am ready to learn SDL for this program.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
Re: Make Console diseapear
I want it so every time the user press a button a sound will play but if they press a certain button the program will quit.
Re: Make Console diseapear
so you dont want any reference window. console or GUI?herby490 wrote:I want it so every time the user press a button a sound will play but if they press a certain button the program will quit.
well i would use FMOD (just because i like it and its so easy to use) and i would make a simple winapi program.
you can find all the worlds info on winapi on google.
another more accessible option in my opinion would be to use something like C builder. i think VS has something like that, but i never use it.
that by default does not have a console due to its GUI'ness, and you can set that the window to visible = false or something to that tune.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
- Joeyotrevor
- Chaos Rift Cool Newbie
- Posts: 62
- Joined: Thu Jan 22, 2009 6:24 pm
- Programming Language of Choice: C++
Re: Make Console diseapear
If you just want to hide the console and still have the application running in the background, you can just do this
You can still receive input if you use GetAsyncKeyState() or GetKeyState().
Code: Select all
HWND hwnd = GetConsoleWindow();
ShowWindow(hwnd, SW_HIDE);
Code: Select all
eb 0c 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 31 d2 8e c2 30 ff b3 0a bd 02 7c b9 0b 00 b8 00 13 cd 10 eb fe