关闭QQ右下角弹窗小程序
关闭QQ右下角弹出的广告或新闻等。
程序没有界面,后台运行。
#if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#elif defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif #include <tchar.h>
#include <windows.h> #include <iostream>
#include <stdio.h>
#include <windows.h>
#include <vector>
#include <time.h>
//#include <afxwin.h>
using namespace std; /* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */
TCHAR szClassName[ ] = _T("CodeBlocksWindowsApp"); char* tmp=new char[];
LPTSTR s=new char[]; char* gettime(){
time_t t = time();
strftime(tmp, , "%Y-%m-%d %H:%M:%S",localtime(&t));
return tmp;
}
char* gettext(HWND hwnd){
GetWindowText(hwnd,s,);
return s;
}
int print_window(HWND hwnd,long w,long h,FILE* f){
printf("%d (%ld,%ld) %s %s\n",(int)hwnd,w,h,gettime(),gettext(hwnd));
fprintf(f,"%d (%ld,%ld) %s %s\n",(int)hwnd,w,h,gettime(),gettext(hwnd));
fflush(f);
return ;
}
int mmain(){
FILE* f=fopen("main_log.txt","a");
cout<<"Start Program."<<endl;
fprintf(f,"\nStart Program.\n");
fflush(f);
HWND qhwnd=NULL;
while(true){
Sleep();
HWND QQhwnd = FindWindow("TXGuiFoundation", "QQ");//OrpheusBrowserHost "QQ"
if (QQhwnd==NULL){
continue;
}
if(qhwnd!=QQhwnd){
qhwnd=QQhwnd;
printf("%s QQ hwnd is %d\n",gettime(),(int)QQhwnd);
fprintf(f,"%s QQ hwnd is %d\n",gettime(),(int)QQhwnd);
fflush(f);
}
HWND hwnd = FindWindow("TXGuiFoundation", NULL);//OrpheusBrowserHost "QQ"
RECT rect;
GetWindowRect(hwnd,&rect);
long w=rect.right-rect.left,h=rect.bottom-rect.top;
//printf("width:%ld height:%ld\n",w,h);
if((w==&&h==)||(w==&&h==)||(w==&&h==)||(w==&&h==)){
print_window(hwnd,w,h,f);
SendMessage(hwnd,WM_CLOSE,,);
//DestroyWindow(hwnd);
}
}
delete []s;
delete []tmp;
return ;
} int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
mmain();
return ;
} /* This function is called by the Windows function DispatchMessage() */ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
} return ;
}
2017年3月底写
END
关闭QQ右下角弹窗小程序的更多相关文章
- 【】关闭QQ右下角各种弹框
[]关闭QQ右下角弹框 一: 二: 超级会员设置过滤(屏蔽)广告后可以过滤哪些广告? 1.可以过滤QQ客户端好友聊天对话框右侧出现的Flash广告.左下角的文案广告: 如图: 2.可以 ...
- 怎么关闭wps热点?永久关闭wps右下角弹窗的方法!
wps热点总是开机或者开启WPS后在任务栏闪烁,影响心情,百度了一下找到的方法也过时了.我的是WIN10系统 所以自己摸索了一下,找到了解决办法.其实还是用空白文件替换wps热点的.exe文件,只是这 ...
- [C++] 自己主动关闭右下角弹窗
近期腾讯.迅雷等各种client,都越发喜欢在屏幕的右下角弹框了. 有骨气的人当然能够把这些软件卸载了事,可是这些client在某些情况下却又还是实用的.怎么办呢? 作为码农,自己实现一个自己主动关闭 ...
- 小程序上传图片功能 uploadFile:fail Read error:ssl=0xa738d808:I/O error during system call,Connection reset by peer
由于纯网页上传图片小程序会闪退,就采用了小程序原生的上传功能wx.uploadfile 处理流程: 1.网页需要跳转到小程序 需要引用 <script src='https://res.wx.q ...
- 小程序通过web-view实现与h5页面之间的交互
在小程序端使用web-view内嵌网页,通过 src 携带参数,通过 @message 接收h5传回的数据 <template> <view> <web-view :sr ...
- 浏览器小程序(Browser Applet)闪亮登场
2017 年 1 月 9 日,微信小程序横空出世.随后,支付宝小程序.今日头条小程序.百度智能小程序.360小程序等纷纷推出,自此国内软件功能扩展领域进入到了小程序时代,小程序为丰富其宿主软件的功能和 ...
- 微信小程序登陆流程
#1:session_key和openId是什么?session_key 官方说明为:session_key是微信服务器生成的针对用户数据进行加密签名的密钥session_key的用途(1)对wx.g ...
- 近期热门微信小程序demo源码下载汇总
近期微信小程序demo源码下载汇总,乃小程序学习分析必备素材!点击标题即可下载: 即速应用首发!原创!电商商场Demo 优质微信小程序推荐 -秀人美女图 图片下载.滑动翻页 微信小程序 - 新词 GE ...
- 微信小程序之 ----API接口
1. wx.request 接口 可在文件 wxs中操作,连接服务器处理数据 参数 ① url ② data ③ header ④ method ⑤ dataType 回调 ...
随机推荐
- 智表(ZCELL)专业版收费说明
一.产品收费方式1.智表专业版按照部署地址授权.(IP或域名均可)2.不同版本单独计价,升级时需要补差价+升级服务费30元. 二.产品价格1.当前智表专业版最新版本为 V1.5版本,价格与上一版本相同 ...
- LinkedList类 和ArrayList类
1)LinkedList类 LinkedList实现了List接口,允许null元素.此外LinkedList提供额外的get,remove,insert方法在 LinkedList的首部或尾部.这 ...
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'. Did you install mysqlclient or MySQL-python?
Error msg: Unhandled exception in thread started by <function check_errors.<locals>.wrapper ...
- C#中的PropertyGrid绑定对象,通过改变某一值而动态设置部分属性的特性
问题:如下,我定义了一个对象,默认设置属性WindowSize ,WindowSize 为不可见,通过改变SaveOnClose的值,动态的改变不可见的属性的显示和隐藏. [DefaultProper ...
- 【刷题】【LeetCode】000-十大经典排序算法
[刷题][LeetCode]总 用动画的形式呈现解LeetCode题目的思路 参考链接 000-十大经典排序算法
- jexus上部署nuget私服vs访问403错误解决方式
因为vs去访问nuget项目的时候是以下面的方式去访问的 http://域名/nuget/Search()?$filter=IsLatestVersion&searchTerm=''& ...
- nginx的配置与应用
Nginx在应用程序中主要有以下作用(应用):1.解决跨域.2.请求过滤.3.配置Gzip.4.负载均衡.5.静态资源服务器. Nginx的配置结构 Nginx主要是通过修改配置文件nginx.con ...
- LeetCode136.只出现一次的数字
给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次.找出那个只出现了一次的元素. 说明: 你的算法应该具有线性时间复杂度. 你可以不使用额外空间来实现吗? 示例 1: 输入: [ ...
- <generatePublisherEvidence> 元素
<configuration> <runtime> <generatePublisherEvidence enabled="false"/> & ...
- c提高第四课
1.一维数组的初始化 , , }; //3个元素 ] = { , , }; //a[3], a[4]自动初始化为0 ] = { }; //全部元素初始化为0 memset(c, , sizeof(c) ...