|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
主要代码如下:
#include "stdafx.h"
#include <windows.h>
BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM param)
{
char strClassName[MAXBYTE] = { 0 };
GetClassNameA(hWnd,strClassName,MAXBYTE);
if(strcmp(strClassName,"TXGuiFoundation") ==0)
{
HWND hQQMain = FindWindowA("TXGuiFoundation","QQ");
;;PostMessageW(hWnd,WM_PASTE,0,0);
;;PostMessageW(hWnd,WM_KEYDOWN,VK_RETURN,0);
CloseWindow(hQQMain);
}
return true;
}
int _tmain(int argc, _TCHAR* argv[])
{
int i;
for(i=0;i<4;i++)
{
HWND hQQMain = FindWindowA("TXGuiFoundation","QQ");
ShowWindow(hQQMain,SW_SHOW);
;;SendMessageA(hQQMain,WM_KEYDOWN,VK_DOWN,0);
;;SendMessageA(hQQMain,WM_KEYDOWN,VK_RETURN,0);
CloseWindow(hQQMain);
EnumWindows(EnumWindowsProc,NULL);
CloseWindow(hQQMain);
}
// HWND hSend = FindWindowA(nullptr,"asm");
return 0;
}
然后碰到了问题,这样无法避免QQ自动合并窗口带来的问题,而且会一直开窗口,把消息全都发给最后一个人,无语,悲催,求大神解决!!!
必有重谢!!!
待大神修改的源码下载地址:http://pan.baidu.com/s/1bo1xwq7 |
-
问题
|