- #include <windows.h>
- #include <stdio.h>
- #include <stdlib.h>
- #define dim(x) (sizeof()/sizeof(x[0]))
- int main()
- {
- system("color 5b");
- /* system("mode con cols=60 lines=8");*/
- system("title Kill Window");
- char sName[80] = {0};
- HWND hWnd = 0;
- puts("====--------------====");
- puts("==== QQ 702368956 ====");
- puts("====--------------====");
- while (1)
- {
- printf("Help You Kill it: ");
- gets(sName);
- hWnd = FindWindow(NULL, sName);
- if (hWnd)
- {
- SendMessage(hWnd, WM_CLOSE, 0, 0);
- break;
- }
- else
- {
- printf(" 没有找到窗口...\\n\\n");
- continue;
- }
- }
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/2811201514100.html
来源: http://www.codesnippet.cn/detail/2811201514100.html