资源简介
c#开发的模拟按键,类似按键精灵的简单代码,可以直接运行winform程序,具有一定的参考价值

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SupKey;
namespace SupKetTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[System.Runtime.InteropServices.DllImport(“user32“)]
private static extern int mouse_event(int dwFlags int dx int dy int cButtons int dwExtraInfo);
const int MouseeventfMove = 0x0001;
const int MouseeventfLeftdown = 0x0002;
const int MouseeventfLeftup = 0x0004;
const int MouseeventfRightdown = 0x0008;
const int MouseeventfRightup = 0x0010;
const int MouseeventfMiddledown = 0x0020;
const int MouseeventfMiddleup = 0x0040;
const int MouseeventfAbsolute = 0x8000;
private void button1_Click(object sender EventArgs e)
{
mouse_event(MouseeventfMove | MouseeventfAbsolute 587 * 65535 / 1600 350 * 65535 / 900 0 0);
mouse_event(MouseeventfLeftdown 0 0 0 0);//点击
mouse_event(MouseeventfLeftup 0 0 0 0);//点击
var supKey = new SupKey.SupKey();
supKey.SendWinio();
supKey.MykeyDown(SupKey.SupKey.VkA);
supKey.MykeyDown(SupKey.SupKey.VkB);
supKey.MykeyDown(SupKey.SupKey.VkC);
supKey.MykeyDown(SupKey.SupKey.VkD);
supKey.MykeyDown(SupKey.SupKey.VkNum0);
supKey.MykeyDown(SupKey.SupKey.VkNum1);
supKey.MykeyDown(SupKey.SupKey.VkNum2);
supKey.MykeyDown(SupKey.SupKey.VkNum3);
supKey.EndWinio();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2023 2015-01-12 10:09 Form1.designer.cs
文件 5814 2015-01-12 10:09 Form1.resx
文件 491 2015-01-12 10:09 Program.cs
文件 3822 2015-01-12 10:10 WindowsFormsApplication1.csproj
文件 8192 2013-09-26 10:48 bin\Release\SupKey.dll
文件 9216 2015-01-12 10:12 bin\Release\WindowsFormsApplication1.exe
文件 19968 2015-01-12 10:12 bin\Release\WindowsFormsApplication1.pdb
文件 11600 2015-01-12 10:14 bin\Release\WindowsFormsApplication1.vshost.exe
文件 490 2010-03-17 22:39 bin\Release\WindowsFormsApplication1.vshost.exe.manifest
文件 49152 2002-03-02 00:22 bin\Release\WinIo.dll
文件 4944 2002-03-01 23:21 bin\Release\WinIo.sys
文件 5174 2002-03-02 00:14 bin\Release\WINIO.VXD
文件 2152 2015-01-12 10:08 obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6253 2015-01-12 10:11 obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 228 2015-01-12 10:11 obj\x86\Debug\GenerateResource.read.1.tlog
文件 594 2015-01-12 10:11 obj\x86\Debug\GenerateResource.write.1.tlog
文件 10871 2015-01-12 10:11 obj\x86\Debug\ResolveAssemblyReference.cache
文件 180 2015-01-12 10:11 obj\x86\Debug\SupKetTest.Form1.resources
文件 798 2015-01-12 10:11 obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
文件 9216 2015-01-12 10:11 obj\x86\Debug\WindowsFormsApplication1.exe
文件 19968 2015-01-12 10:11 obj\x86\Debug\WindowsFormsApplication1.pdb
文件 180 2015-01-12 10:11 obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources
文件 6257 2015-01-12 10:12 obj\x86\Release\DesignTimeResolveAssemblyReferencesInput.cache
文件 228 2015-01-12 10:12 obj\x86\Release\GenerateResource.read.1.tlog
文件 602 2015-01-12 10:12 obj\x86\Release\GenerateResource.write.1.tlog
文件 180 2015-01-12 10:12 obj\x86\Release\SupKetTest.Form1.resources
文件 818 2015-01-12 10:14 obj\x86\Release\WindowsFormsApplication1.csproj.FileListAbsolute.txt
文件 9216 2015-01-12 10:12 obj\x86\Release\WindowsFormsApplication1.exe
文件 19968 2015-01-12 10:12 obj\x86\Release\WindowsFormsApplication1.pdb
文件 180 2015-01-12 10:12 obj\x86\Release\WindowsFormsApplication1.Properties.Resources.resources
............此处省略18个文件信息
- 上一篇:WPF 串口与网口数据互转工具
- 下一篇:用C#2010编写K3插件
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论