实现:调用API函数ShowWindow()来隐藏窗口

只需要将相应代码复制即可。

代码如下:

#include <iostream> 

#include <windows.h> 

int main() 

{

 HWND hDos; //声明窗口句柄变量

 hDos=GetForegroundWindow(); //当前窗口句柄 
 hDos = FindWindow(NULL, TEXT("TeamViewer")); //指定进程名的句柄

ShowWindow(hDos,SW_HIDE); //隐藏窗口

//中间代码

ShowWindow(hDos,SW_SHOW);//显示窗口

 return 0; 

}

原文地址:https://www.cnblogs.com/zpchcbd/p/11873201.html