没有合适的资源?快使用搜索试试~ 我知道了~
自动按键ctrl+s
4星 · 超过85%的资源 需积分: 43 62 下载量 72 浏览量
2009-05-12
16:36:16
上传
评论 1
收藏 1KB TXT 举报
温馨提示
试读
2页
C#可以实现自动按键ctrl+s,方便实现智能化
资源推荐
资源详情
资源评论
using System;
using System.Threading;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace KeyBoardControl
{
class KeyBoardControl
{
const int MOUSEEVENTF_LEFTDOWN = 0x2;
const int MOUSEEVENTF_LEFTUP = 0x4;
public struct PONITAPI
{
public int x, y;
}
[DllImport("user32.dll")]
public static extern int GetCursorPos(ref PONITAPI p);
[DllImport("user32.dll")]
public static extern int SetCursorPos(int x, int y);
[DllImport("user32.dll")]
public static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
[DllImport("user32.dll")]
public static extern int keybd_event(uint bVk, uint bScan, int dwFlags, int dwExtraInfo);
//四个参数第一个为按键的虚拟键值,第二个为扫描,第三个为按下或者弹起的值,第四个为扩展标识
[STAThread]
static void Main(string[] args)
using System.Threading;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace KeyBoardControl
{
class KeyBoardControl
{
const int MOUSEEVENTF_LEFTDOWN = 0x2;
const int MOUSEEVENTF_LEFTUP = 0x4;
public struct PONITAPI
{
public int x, y;
}
[DllImport("user32.dll")]
public static extern int GetCursorPos(ref PONITAPI p);
[DllImport("user32.dll")]
public static extern int SetCursorPos(int x, int y);
[DllImport("user32.dll")]
public static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
[DllImport("user32.dll")]
public static extern int keybd_event(uint bVk, uint bScan, int dwFlags, int dwExtraInfo);
//四个参数第一个为按键的虚拟键值,第二个为扫描,第三个为按下或者弹起的值,第四个为扩展标识
[STAThread]
static void Main(string[] args)
资源评论
- 太阳下的思索2018-09-06不错,谢谢分享。
- caiweichun2012-12-28只能在界面窗口运行,游戏会被屏蔽
junsanrao
- 粉丝: 19
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功