WINAPI 表白

可以试一下 水平不高但感觉创意还是有的  送给你了

效果是      打开你的画图,给你画一个♥:)

#include<iostream>
#include<assert.h>
#include<windows.h>
#include<math.h>
#define R 10
#define PI 3.14159265359
#define ox 410
#define oy 210
using namespace std;
int main()
{    cout<<"from ink_cherry"<<endl;
    int a[10]={77,83,80,65,73,78,84,13,13};
     keybd_event(91,0,0,0);
     keybd_event(82,0,0,0);
     Sleep(50);
     keybd_event(82,0,KEYEVENTF_KEYUP,0);
     keybd_event(91,0,KEYEVENTF_KEYUP,0);
     for(int i=0;i<9;i++)
     {
         Sleep(300);
         keybd_event(a[i],0,0,0);
         Sleep(50);
         keybd_event(a[i],0,KEYEVENTF_KEYUP,0);
     }

    HWND hwnd;
    POINT cursor;
    Sleep(3000);
//     SetCursorPos(10,171);
//    GetCursorPos(&cursor);
    cursor.x=ox;cursor.y=oy;
    hwnd=WindowFromPoint(cursor);
//      SendMessage(hwnd, WM_LBUTTONDOWN, NULL, MAKELPARAM(cursor.x, cursor.y));
    SendMessage(hwnd, WM_LBUTTONDOWN, NULL, MAKELPARAM(cursor.x-R*(16*sin(PI/2)*sin(PI/2)*sin(PI/2)), cursor.y-R*(-5*cos(PI)-cos(2*PI)))); //°´Ï°´Å¥

    for(double i=PI/2;i<PI*5/2;i=i+0.01)
    {
    Sleep(5);

//  SendMessage(hwnd,WM_MOUSEMOVE,NULL,MAKELPARAM(i, point1.y));
//    SendMessage(hwnd,WM_MOUSEMOVE,NULL,MAKELPARAM((cursor.x)+i  ,cursor,y));
      SendMessage(hwnd,WM_MOUSEMOVE,NULL,MAKELPARAM(ox-R*(16*sin(i)*sin(i)*sin(i)),oy-R*(13*cos(i)-5*cos(2*i)-2*cos(3*i)-cos(4*i))));
//      cout<<ox+R*(cos(i))<<" "<<oy+R*(sin(i))<<endl;
    }
    SendMessage(hwnd,WM_LBUTTONUP,NULL,MAKELPARAM(cursor.x-R*(16*sin(PI/2)*sin(PI/2)*sin(PI/2)),oy-R*(-5*cos(PI)-cos(2*PI))));
    return 0;
}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值