很简单,但是可以不再见到“腾讯网新闻”了,省去手动关闭之烦恼!
// CloseWin.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
#pragma comment(linker,"/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
int main(int argc, _TCHAR* argv[])
{
while(1)
{
HWND hWnd = FindWindow(_T("TXGuiFoundation"),_T("腾讯网新闻"));
if (hWnd)
{
SendMessage(hWnd,WM_SYSCOMMAND,SC_CLOSE,NULL);
}
Sleep(5000);
}
return 0;
}
阅读(560) | 评论(0) | 转发(0) |