不显示窗口:用ShowWidow使窗口Hide
SetWindowPos给窗口加上WS_EX_TOOLWINDOW属性,使窗口不在下面任务栏里显示。
注册成服务器程序:
void Hide_proc()
{
    HINSTANCE hDllInst = LoadLibrary("KERNEL32.DLL"); 
    if(hDllInst) 
    {        
        typedef DWORD (WINAPI *MYFUNC)(DWORD,DWORD); 
    
        MYFUNC RegisterServiceProcessAlias = NULL; 
 
        RegisterServiceProcessAlias = (MYFUNC)GetProcAddress(hDllInst, "RegisterServiceProcess"); 
    
        if(RegisterServiceProcessAlias) 
        {    
            RegisterServiceProcessAlias(GetCurrentProcessId(),1); 
        } 
    FreeLibrary(hDllInst); 
 }
}
或者
在注册表的RunServerice里面注册,这样下次启动才能生效。
但都不能彻底隐藏