WCF/WF - How to hide console window in windows ce6.0?

Asked By Laxmi on 28-Feb-11 06:49 AM
Dear All,

I am creating a platform builder for Wince6.0 using VS2005  , I need to run the multiple exe's by adding subproject to the platform(Osdesign), So I want to hide the console window while running the multiple exe's .
Could anyone please help me , how to do?

Thanks for your help and suggestion in advance.

Thanks and regards,
Laxmi
Anoop S replied to Laxmi on 28-Feb-11 10:34 AM

Try this:

    using System.Runtime.InteropServices;

 

...

    [DllImport("user32.dll")]

    public static extern IntPtr FindWindow(string lpClassName,string lpWindowName);

 

    [DllImport("user32.dll")]

    static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

 

...

 

     //Sometimes System.Windows.Forms.Application.ExecutablePath works for the caption depending on the system you are running under.

     IntPtr hWnd = FindWindow(null, "Your console windows caption"); //put your console window caption here

     if(hWnd != IntPtr.Zero)

     {

        //Hide the window

        ShowWindow(hWnd, 0); // 0 = SW_HIDE

     }

 

          

     if(hWnd != IntPtr.Zero)

     {

        //Show window again

        ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA

     }


Laxmi replied to Anoop S on 28-Feb-11 10:53 PM
Dear Anoop ,

Thanks for your suggestion.

Can i use this for cpp or c code? if i can what's header file i need to include in Wince6.0

Thanks and Regards,
Laxmi