了解有关Windows坐标系的更多信息。C不包括“单击”,因为它是一种通用语言,适用于可能没有GUI或鼠标的平台(例如嵌入式、操作系统开发等)

了解有关Windows坐标系的更多信息。C不包括“单击”,因为它是一种通用语言,适用于可能没有GUI或鼠标的平台(例如嵌入式、操作系统开发等),c,winapi,C,Winapi,点击是由操作系统提供的,通过一个驱动程序来管理鼠标本身(可能还有USB端口),还有一些其他系统:图形桌面、鼠标设置等 因此,每个操作系统都提供自己的API来访问鼠标功能 幸运的是,由于任何好的软件都关心it用户的自由(以及it开发者/公司的自由),一些库在操作系统上实现了一个抽象层,使得开发在Linux、Windows、MacOS、Solaris等平台上工作的应用程序变得微不足道 对于纯C,您可以使用GTK() 或者使用C++,使用Qt(我建议使用Qt,因为pur-C项目往往会消失)。我最终得到

点击是由操作系统提供的,通过一个驱动程序来管理鼠标本身(可能还有USB端口),还有一些其他系统:图形桌面、鼠标设置等

因此,每个操作系统都提供自己的API来访问鼠标功能

幸运的是,由于任何好的软件都关心it用户的自由(以及it开发者/公司的自由),一些库在操作系统上实现了一个抽象层,使得开发在Linux、Windows、MacOS、Solaris等平台上工作的应用程序变得微不足道

对于纯
C
,您可以使用GTK()


或者使用
C++
,使用Qt(我建议使用Qt,因为pur-C项目往往会消失)。

我最终得到了这段代码。所以基本上我不仅要打开一个webex链接和joning,还想关闭chrome标签。这正是我所做的

     #include <stdio.h>
 #include <winuser.h>
#include <unistd.h>
 #include <stdlib.h>
 
 int main(){
     int number;
     
printf("1. Lesson1 \n2. Lesson2\n3. Lesson3\n4. Lesson4\n5. Lesson5\n6. Lesson6\n7. lesson7\n8. Lesson8\n9. Lesson9\n10. Lesson10 \n11. Lesson11\n12. Lesson12\n13. Lesson13\n Please enter a number: ");
scanf("%d",&number);

 int ptx=1100;
  int pty=980;
  int ptx2=-20;
  int pty2=10;


  switch (number)
  {
     case 1:
     system("start link1");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 2: 
     system ("start link2");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 3: 
     system ("start link3");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 4:
      system ("start link4");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;
     
     case 5: 
     system ("start link5");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 6: 
     system ("start link6");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 7: 
     system ("start  link7 ");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 8: 
     system ("start link8");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 9:
     system ("start link9");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 10:
     system ("start link10");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 11:
     system ("start link11");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 12: 
     system ("start  link12");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 13:
     system ("start link13);
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;
    
     default: 
     printf("Invalid number.Please try again.");
     break;
  }
 } 



 
   
#包括
#包括
#包括
#包括
int main(){
整数;
printf(“1.Lesson1\n2.Lesson2\n3.Lesson3\n4.Lesson4\n5.Lesson5\n6.Lesson6\n7.lesson7\n8.Lesson8\n9.Lesson9\n10.Lesson10\n11.Lesson11\n12.Lesson12\n13.Lesson13\n请输入数字:”;
scanf(“%d”和编号);
int ptx=1100;
int pty=980;
int ptx2=-20;
int pty2=10;
开关(编号)
{
案例1:
系统(“启动链接1”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例2:
系统(“启动链接2”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例3:
系统(“启动链接3”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例4:
系统(“启动链接4”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例5:
系统(“启动链接5”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例6:
系统(“启动链接6”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例7:
系统(“启动链接7”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例8:
系统(“启动链接8”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例9:
系统(“启动链接9”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例10:
系统(“启动链接10”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例11:
系统(“启动链接11”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例12:
系统(“启动链接12”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
案例13:
系统(“启动链接13”);
SetCursorPos(ptx,pty);
睡眠(6);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
睡眠(1);
SetCursorPos(ptx2,pty2);
鼠标事件(MOUSEEVENTF_LEFTDOWN,0,0,0);
鼠标事件(MOUSEEVENTF_LEFTUP,0,0,0);
打破
违约:
printf(“无效号码。请重试。”);
打破
}
} 

您不能在标准C中输入单击。请阅读.Y进行检查
     #include <stdio.h>
 #include <winuser.h>
#include <unistd.h>
 #include <stdlib.h>
 
 int main(){
     int number;
     
printf("1. Lesson1 \n2. Lesson2\n3. Lesson3\n4. Lesson4\n5. Lesson5\n6. Lesson6\n7. lesson7\n8. Lesson8\n9. Lesson9\n10. Lesson10 \n11. Lesson11\n12. Lesson12\n13. Lesson13\n Please enter a number: ");
scanf("%d",&number);

 int ptx=1100;
  int pty=980;
  int ptx2=-20;
  int pty2=10;


  switch (number)
  {
     case 1:
     system("start link1");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 2: 
     system ("start link2");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 3: 
     system ("start link3");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 4:
      system ("start link4");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;
     
     case 5: 
     system ("start link5");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 6: 
     system ("start link6");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 7: 
     system ("start  link7 ");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 8: 
     system ("start link8");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 9:
     system ("start link9");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 10:
     system ("start link10");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 11:
     system ("start link11");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 12: 
     system ("start  link12");
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;

     case 13:
     system ("start link13);
     SetCursorPos(ptx, pty);
     sleep(6);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     sleep(1);
     SetCursorPos(ptx2, pty2);
     mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
     mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
     break;
    
     default: 
     printf("Invalid number.Please try again.");
     break;
  }
 }