June 21st, 2010 11:15 PM
#1
close the console once GUI is loaded?
Hello,
My application needs to be started through console.. Or in other words, on double clicking, myprog.exe, a small terminal opens, which leads a GUI window to be displayed.. What i want is to close the console once my GUI is loaded. How can i do this.??
Thanks
June 22nd, 2010 12:04 AM
#2
Re: close the console once GUI is loaded?
Create a console with:
Code:
// Allocate a new console.
AllocConsole();
// Redirect stdout to the console.
_tfreopen( _T("CONOUT$"), ("a+t"), stdout);
When you're done with it...
Consult msdn for options with regard to _tfreopen params.
__________________________________________________________
Arjay
See my latest series on using WCF to communicate between a Windows Service and WPF task bar application.
Tray Notify - Part I Tray Notify - Part II
Need a little help with Win32 thread synchronization? Check out the following CG articles and posts:
Sharing a thread safe std::queue between threads w/progress bar updating
Simple Thread: Part I Simple Thread: Part II
Win32 Thread Synchronization, Part I: Overview Win32 Thread Synchronization, Part 2: Helper Classes
www.iridyn.com
June 22nd, 2010 03:00 AM
#3
Re: close the console once GUI is loaded?
Hi..
By doing this, will i be able to view only GUI app..? or along with that separate console will be coming..??
I dont want console at all to be displayed.. its ok if it is running in background or invisible..
Thanks
June 22nd, 2010 03:20 AM
#4
Re: close the console once GUI is loaded?
Code:
int main()
{
::ShowWindow(::GetConsoleWindow(), SW_HIDE);
// ...
}
June 22nd, 2010 07:24 AM
#5
Re: close the console once GUI is loaded?
Originally Posted by
rakeshthp
Hi..
By doing this, will i be able to view only GUI app..? or along with that separate console will be coming..??
I dont want console at all to be displayed.. its ok if it is running in background or invisible..
Thanks
Why not try the code I posted and find out? Then try Ovidio's code.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks