Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have written a console application code as follow:
MSIL
#include<windows.h>
#include<stdio.h>
{
    system("route -p add 0.0.0.0 mask 0.0.0.0 192.168.15.23");
}

When I turn it into MFC/SDK,the application still appears the black console window. But that is not what I want because the Black Window is not beautiful. I want to hide it or write other function having the same funcion to repalce
MSIL
system("route -p add 0.0.0.0 mask 0.0.0.0 192.168.15.23");

Could someone tell me How to do it ? Show me your code.
Thank you in advance.
Posted
Updated 21-Jun-10 15:09pm
v4

1 solution

Use the CreateProcess API instead of the system function.
In the STARTUPINFO structure parameter, set dwFlags as STARTF_USESHOWWINDOW and wShowWindow as SW_HIDE.
 
Share this answer
 
Comments
eagle_chen 22-Jun-10 1:06am    
Thanks! I will try it later.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900