珍しく全力で仕事したせいで、指が痛い……。
というわけで、指を使わなくても自動でクリックするためのプログラム。※自分メモ。
using System.Runtime.InteropServices;namespace ConsoleApplication1 { class Program { [DllImport("USER32.dll", CallingConvention = CallingConvention.StdCall)] static extern void SetCursorPos(int X, int Y); [DllImport("USER32.dll", CallingConvention = CallingConvention.StdCall)] static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); private const int MOUSEEVENTF_LEFTDOWN = 0x2; private const int MOUSEEVENTF_LEFTUP = 0x4; static void Main(string[] args) { SetCursorPos(300, 300); mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); } } }
![]() |
新品価格 |
