网上有很多的例子都说可以修改linker的subsystem熟悉来实现。

#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )

但这种方法我们需要自己提供一个额外的WinMain入口函数。

事实上一种比较简单的方法去隐藏控制台程序的窗口是利用 FreeConsole() 函数来实现。对于的函数AllocConsole()是用来显示窗口。

int _tmain(int argc, _TCHAR* argv[])
{
    FreeConsole();

    Configuration
* pConfig = Configuration::GetInstance();
    
if (argc == 2)
    {
        pConfig
->SetMonitorFolder(argv[1]);
    }
    
return 0;
}

 

 

 

 

相关文章:

  • 2021-12-23
  • 2021-04-06
  • 2021-12-16
  • 2021-12-04
  • 2021-12-06
  • 2021-11-20
  • 2021-12-18
  • 2021-05-05
猜你喜欢
  • 2021-10-09
  • 2021-12-06
  • 2021-06-14
  • 2021-04-06
  • 2021-11-14
  • 2021-11-14
  • 2021-10-11
  • 2021-12-12
相关资源
相似解决方案