GUI and Console Application within single application
Hi Guys,
today i am in some very diiferent scenario
My client needed a GUI and Console Application within single application.
I am able to achieve using just wriiten Main and then called WinMain based on commnadline parameters
Code:
HINSTANCE inst;
inst=(HINSTANCE)GetModuleHandle(NULL);
WinMain(inst,NULL,buf,SW_SHOWNORMAL);
But if commnadline parameters say should be window based, then i hide console window using
Code:
HWND console = GetConsoleWindow();
ConsoleWindow = 0;
if(IsWindow(console))
ShowWindow(console,SW_HIDE); // hides the window
but as i tried to hide, it created an issue for me when i run this application on console window, it hide console window.
so is there any way so i will be able to get whether it is run through Windows double click or througth console window. or any good solution for this issue
Re: [RESOLVED] GUI and Console Application within single application
Re: [RESOLVED] GUI and Console Application within single application
Quote:
Originally Posted by
ashukasama
Done using FreeConsole
not worked as if launched from console window it will not leave console application
Re: [RESOLVED] GUI and Console Application within single application
Whenever I have that requirement, I just create a dialog application and show the dialog or not depending on command line switches.
Re: [RESOLVED] GUI and Console Application within single application
it will have same issue like
it will be deattached from parent console window if i run application as console mode in console window.