找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 4965|回复: 0

[开源] 反QQ2011弹窗:AQQPW

[复制链接]

857

主题

2632

回帖

2

精华

管理员

此生无悔入华夏,  长居日耳曼尼亚。  

积分
36130
发表于 2011-10-1 16:35:40 | 显示全部楼层 |阅读模式
不知道大家有没有发现,QQ2011的弹窗多了很多,于是写了份破代码来反弹窗,支持用VC2010编译成X86和X64程序。

  1. //Author: Tesla.Angela
  2. //Time: 2011-09-24
  3. #include <stdio.h>
  4. #include <Windows.h>

  5. #pragma comment(lib, "user32.lib")

  6. void GetWindowSize(HWND hWnd, LONG *width, LONG *height)
  7. {
  8.         RECT Rect = {0};
  9.         GetWindowRect(hWnd,&Rect);
  10.         *width = Rect.right-Rect.left;
  11.         *height = Rect.bottom-Rect.top;
  12. }

  13. //char *GetWndText(HWND hWnd)
  14. //{
  15. //        int len = GetWindowTextLengthA(hWnd);
  16. //        char *buffer = (char *)malloc(len+1);
  17. //        memset(buffer,0,len+1);
  18. //        GetWindowTextA(hWnd,buffer,len+1);
  19. //        return buffer;
  20. //}

  21. BOOL IsInSize(LONG width, LONG height)
  22. {
  23.         if(width>200 && width<300 && height>100 && height<200)
  24.                 return TRUE;
  25.         else
  26.                 return FALSE;
  27. }

  28. int main()
  29. {
  30.         HWND hWnd = 0;
  31.         LONG width = 0, height = 0, i=0;
  32.         printf("Function: Prevent QQ to popping AD windows\nAuthor: Tesla.Angela\n");
  33.         printf("Usage: Keep this program running, it will auto close all AD popup windows.\n       Use TASKMGR to kill its process when you don't want to this program.\n");
  34.         printf("\nPress [ENTER] to continue & minimize this window...");
  35.         getchar();
  36.         ShowWindow(GetConsoleWindow(),SW_HIDE);
  37. bgn:
  38.         hWnd = FindWindowW(L"TXGuiFoundation",L"QQ2011");
  39.         if(hWnd == NULL)
  40.         {
  41.                 Sleep(100);
  42.                 goto nxt;
  43.         }
  44.         while(i < 0xFF)
  45.         {
  46.                 hWnd = FindWindowExW(0,hWnd,L"TXGuiFoundation",NULL);
  47.                 GetWindowSize(hWnd,&width,&height);
  48.                 //printf("%x,%dx%d,%s\n",hWnd,width,height,GetWndText(hWnd));
  49.                 if(IsInSize(width,height))
  50.                         SendMessageW(hWnd,WM_CLOSE,0,0);
  51.                 i++;
  52.         }
  53.         i = 0;
  54.         Sleep(100);
  55. nxt:
  56.         goto bgn;
  57.         getchar();
  58.         return 0;
  59. }
复制代码

AQQPW.rar

47.6 KB, 下载次数: 4962

编译好的文件

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表