反QQ2011弹窗:AQQPW
不知道大家有没有发现,QQ2011的弹窗多了很多,于是写了份破代码来反弹窗,支持用VC2010编译成X86和X64程序。//Author: Tesla.Angela
//Time: 2011-09-24
#include <stdio.h>
#include <Windows.h>
#pragma comment(lib, "user32.lib")
void GetWindowSize(HWND hWnd, LONG *width, LONG *height)
{
RECT Rect = {0};
GetWindowRect(hWnd,&Rect);
*width = Rect.right-Rect.left;
*height = Rect.bottom-Rect.top;
}
//char *GetWndText(HWND hWnd)
//{
// int len = GetWindowTextLengthA(hWnd);
// char *buffer = (char *)malloc(len+1);
// memset(buffer,0,len+1);
// GetWindowTextA(hWnd,buffer,len+1);
// return buffer;
//}
BOOL IsInSize(LONG width, LONG height)
{
if(width>200 && width<300 && height>100 && height<200)
return TRUE;
else
return FALSE;
}
int main()
{
HWND hWnd = 0;
LONG width = 0, height = 0, i=0;
printf("Function: Prevent QQ to popping AD windows\nAuthor: Tesla.Angela\n");
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");
printf("\nPress to continue & minimize this window...");
getchar();
ShowWindow(GetConsoleWindow(),SW_HIDE);
bgn:
hWnd = FindWindowW(L"TXGuiFoundation",L"QQ2011");
if(hWnd == NULL)
{
Sleep(100);
goto nxt;
}
while(i < 0xFF)
{
hWnd = FindWindowExW(0,hWnd,L"TXGuiFoundation",NULL);
GetWindowSize(hWnd,&width,&height);
//printf("%x,%dx%d,%s\n",hWnd,width,height,GetWndText(hWnd));
if(IsInSize(width,height))
SendMessageW(hWnd,WM_CLOSE,0,0);
i++;
}
i = 0;
Sleep(100);
nxt:
goto bgn;
getchar();
return 0;
}
页:
[1]