过程, 注册热键Shift + O 死循环判断缓存区 , 判断是否为 广告窗口类名 对此取得进程ID 进行关闭结束 。 新版的腾讯视频已经把广告融进主进程 QQlive.exe, 所以已经无法通过旧版的结束进程跳过广告。
// QQlive.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
int main(int argc, char* argv[])
{
if (RegisterHotKey(
NULL,
1,
MOD_SHIFT | 0x4000,
'O')) //0x42 is 'b'
{
printf("鼠标对着广告,通过按键 'Shift + o 即可跳过广告'\n");
}
MSG msg = {0};
while (GetMessage(&msg, NULL, 0, 0) != 0)
{
if (msg.message == WM_HOTKEY)
{
printf("跳过广告\n");
POINT p;
if(GetCursorPos(&p)){
HWND hWnd = ::WindowFromPoint(p);
if(::IsWindow(hWnd)){
char a[100]={0};
GetClassNameA(hWnd,a,100);
if(strcmp("MacromediaFlashPlayerActiveX",a)!=0)
continue;
DWORD id=0;
GetWindowThreadProcessId(hWnd,&id);
if(id!=0){ //MacromediaFlashPlayerActiveX
TerminateProcess(OpenProcess(1,0,id),0);
}
}
}
}
}
return 0;
}
0 条评论