using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
/**//// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(88, 184);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(80, 80);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "textBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/**//// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
// Get a handle to an application window.
[DllImport("USER32.DLL")]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
// Activate an application window.
[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
// Send a series of key presses to the Calculator application.
private void button1_Click(object sender, EventArgs e)
{
// Get a handle to the Calculator application. The window class
// and window name were obtained using the Spy++ tool.
IntPtr calculatorHandle = FindWindow(null, "计算器");
// Verify that Calculator is a running process.
if (calculatorHandle == IntPtr.Zero)
{
MessageBox.Show("Calculator is not running.");
return;
}
// Make Calculator the foreground application and send it
// a set of calculations.
SetForegroundWindow(calculatorHandle);
SendKeys.SendWait("111");
SendKeys.SendWait("*");
SendKeys.SendWait("11");
SendKeys.SendWait("=");
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
c#模拟软键盘事件是个小软键盘
共25个文件
js:7个
css:5个
axd:4个
3星 · 超过75%的资源 需积分: 4 39 下载量 66 浏览量
2009-05-15
09:09:14
上传
评论
收藏 108KB RAR 举报
温馨提示
在vs2008中c#模拟软键盘,很好用,建议初学者用用试试啊!在vs2008中c#模拟软键盘,很好用,建议初学者用用试试啊!
资源推荐
资源详情
资源评论
收起资源包目录
c#模拟键盘事件.rar (25个子文件)
c#模拟键盘事件
关于键盘输入 - sunrack - 博客园.htm 86KB
c#模拟键盘事件.txt 67B
C#模拟键盘鼠标事件_最新百度站.htm 22KB
+如何模拟键盘输入.rar 23KB
关于键盘输入 - sunrack - 博客园.files
xml(1).gif 130B
WebResource.axd 20KB
ScriptResource(2).axd 29KB
ShowHidden.js 3KB
common.js 609B
xml.gif 404B
common.css 1KB
js 3KB
ScriptResource.axd 21KB
ScriptResource(1).axd 82KB
style.css 9KB
JpegImage.jpg 2KB
685159.jpg 631B
show_ads.js 19KB
C#模拟键盘鼠标事件_最新百度站.files
space.css 27KB
global.js 7KB
popup.js 14KB
mods.css 4KB
g_spjs.js 2KB
0ed1f5039345d688d43f7c48.css 16KB
c#模拟键盘事件2.txt 4KB
共 25 条
- 1
资源评论
- yuemen2012-10-01好伤心啊。。这就叫模拟系统软键盘??完全是动画,根本就不能使用
- EricLiang2013-03-06这也叫系统软键盘??
- dengzhikun23452013-03-30没使用上,哎,后悔下载了!
jiemengw
- 粉丝: 6
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功