CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    May 2007
    Posts
    437

    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
    ashu
    always use code tag

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured