发送QQ消息
#include <iostream>
#include <windows.h>
#include <vector>
using namespace std;
int main()
{
//HWND qqhwnd = FindWindow(L"TXGuiFoundation", L" 我旳薆 很低調;;");
//SetForegroundWindow(qqhwnd);//设置QQ主界面最上面显示
//SetCursorPos(0, 0);
//mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0);
// int i = 6;
// while (i-->0)
// {
// char msg[1000]="\0";
// sprintf_s(msg, "%d", i);
//HWND hWnd = NULL;
//OpenClipboard(hWnd);//打开剪切板
//EmptyClipboard();//清空剪切板
//HANDLE hHandle = GlobalAlloc(GMEM_FIXED, 1000);//分配内存
//char* pData = (char*)GlobalLock(hHandle);//锁定内存,返回申请内存的首地址
//strcpy_s(pData, 1000, msg);//或strcpy(pData, "this is a ClipBoard Test.");
//SetClipboardData(CF_TEXT, hHandle);//设置剪切板数据
//GlobalUnlock(hHandle);//解除锁定
//CloseClipboard();//关闭剪切板
//SendMessage(qqhwnd, WM_PASTE, 0, 0);//粘贴
//SendMessage(qqhwnd, WM_KEYDOWN, VK_RETURN, 0);//回车
//
// //Sleep(60);
// }
//keybd_event(VK_CONTROL, 0, 0, 0);//按下Ctrl
//keybd_event('v', 0, 0, 0);//按下v
//keybd_event('v', 0, 2, 0);//弹起v
//keybd_event(VK_CONTROL, 0, 2, 0);//弹起Ctrl
system("pause");
}