|
-
July 16th, 2010, 03:29 AM
#1
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
Last edited by ashukasama; July 16th, 2010 at 05:00 AM.
Reason: not resolved
-
July 16th, 2010, 03:53 AM
#2
Re: [RESOLVED] GUI and Console Application within single application
-
July 16th, 2010, 05:01 AM
#3
Re: [RESOLVED] GUI and Console Application within single application
 Originally Posted by ashukasama
Done using FreeConsole
not worked as if launched from console window it will not leave console application
-
July 16th, 2010, 07:09 AM
#4
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.
-
July 16th, 2010, 07:47 AM
#5
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.
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
|