zoukankan      html  css  js  c++  java
  • mouse_event,keybd_event

    mouse_event

    代码
    procedure MyMouseClick();
    begin
    mouse_event(MOUSEEVENTF_LEFTDOWN,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP,
    0, 0, 0, 0);
    end;

    procedure MyMouseDBClick()
    begin
    mouse_event(MOUSEEVENTF_LEFTDOWN,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTDOWN,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP,
    0, 0, 0, 0);
    end;
    代码
    void MyMouseClick()
    {
    mouse_event(MOUSEEVENTF_LEFTDOWN,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP,
    0, 0, 0, 0);
    }

    void MyMouseDBClick()
    {
    mouse_event(MOUSEEVENTF_LEFTDOWN,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTDOWN,
    0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP,
    0, 0, 0, 0);
    }
    keybd_event

    代码
    //a
    keybd_event(Ord(
    'A'), KEYEVENTF_EXTENDEDKEY or 0, 0);
    keybd_event(Ord(
    'A'), 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
    //A
    keybd_event(VK_SHIFT,
    0, KEYEVENTF_EXTENDEDKEY or 0, 0);
    keybd_event(Ord(
    'A'), KEYEVENTF_EXTENDEDKEY or 0, 0);
    keybd_event(Ord(
    'A'), 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
    keybd_event(VK_SHIFT,
    0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
    //Ctrl + A
    keybd_event(VK_CONTROL,
    0, KEYEVENTF_EXTENDEDKEY or 0, 0);
    keybd_event(
    65, 0, KEYEVENTF_EXTENDEDKEY or 0, 0);
    keybd_event(
    65, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
    keybd_event(VK_CONTROL,
    0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);

  • 相关阅读:
    获取设备型号
    笔记
    福大软工 · 最终作业
    福大软工 · 第十二次作业
    Beta 冲刺(7/7)
    Beta 冲刺(6/7)
    Beta 冲刺(5/7)
    Beta 冲刺(4/7)
    Beta 冲刺(3/7)
    Beta 冲刺(2/7)
  • 原文地址:https://www.cnblogs.com/Jekhn/p/1918650.html
Copyright © 2011-2022 走看看