网上有很多的例子都说可以修改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;
}

 

 

 

 

相关文章:

  • 2022-12-23
  • 2021-05-17
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案