设置程序在任务管理器隐藏,在进程可见

 

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    try
    {
         Application->Initialize();
         Application->CreateForm(__classid(TForm1), &Form1);
         Application->ShowMainForm = False;       //关键之处 控制是否显示程序
         ShowWindow(Application->Handle,SW_HIDE);        //关键之处 控制是否在任务栏显示 SHOW为显示
         Application->Run();
    }
    catch (Exception &exception)
    {
         Application->ShowException(&exception);
    }
    catch (...)
    {
         try
         {
             throw Exception("");
         }
         catch (Exception &exception)
         {
             Application->ShowException(&exception);
         }
    }
    return 0;
}

你可能感兴趣的:(C++)