Hello,
I have crated console based application project in vc++. After completing I realize I should hide the console of app. It is an exe running in background and another exe takes data from through socket programming.

To hide the console as my exe starts I used
Code:
                       HWND hWnd = GetConsoleWindow();
                       ShowWindow( hWnd, SW_HIDE );

But it does not hide console immediately.

When I click on exe; first console gets visible then these lines get executed and hide it. But I don't want to load console. Because currently I am able view the console for few seconds or milliseconds. I want it to be completely silent ( or invisible).

Is there any way ???