资源简介

C#使用SendKeys发送组合键,向指定窗口。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
           
        }

        private void Form1_Load(object sender EventArgs e)
        {
            KeyboardHook keyboardHook = new KeyboardHook();//全局按键
            keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown);
            keyboardHook.Start();
        }

        void keyboardHook_KeyDown(object sender KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                SendKeys.Send(“^a“);
            }

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      24576  2010-03-24 13:12  SendKeys发送组合键\WindowsApplication1\bin\Debug\WindowsApplication1.exe

     文件      32256  2010-03-24 13:12  SendKeys发送组合键\WindowsApplication1\bin\Debug\WindowsApplication1.pdb

     文件       5632  2005-11-11 22:25  SendKeys发送组合键\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe

     文件        832  2010-03-24 13:12  SendKeys发送组合键\WindowsApplication1\Form1.cs

     文件       1474  2010-03-24 12:35  SendKeys发送组合键\WindowsApplication1\Form1.Designer.cs

     文件       5814  2010-03-24 12:35  SendKeys发送组合键\WindowsApplication1\Form1.resx

     文件       6235  2010-03-24 12:35  SendKeys发送组合键\WindowsApplication1\GlobalHook.cs

     文件       4277  2010-03-24 12:37  SendKeys发送组合键\WindowsApplication1\KeyboardHook.cs

     文件        842  2010-03-24 12:37  SendKeys发送组合键\WindowsApplication1\obj\Debug\WindowsApplication1.csproj.GenerateResource.Cache

     文件      24576  2010-03-24 13:12  SendKeys发送组合键\WindowsApplication1\obj\Debug\WindowsApplication1.exe

     文件        180  2010-03-24 12:37  SendKeys发送组合键\WindowsApplication1\obj\Debug\WindowsApplication1.Form1.resources

     文件      32256  2010-03-24 13:12  SendKeys发送组合键\WindowsApplication1\obj\Debug\WindowsApplication1.pdb

     文件        180  2010-03-24 12:37  SendKeys发送组合键\WindowsApplication1\obj\Debug\WindowsApplication1.Properties.Resources.resources

     文件        352  2010-03-24 13:12  SendKeys发送组合键\WindowsApplication1\obj\WindowsApplication1.csproj.FileList.txt

     文件        478  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1\Program.cs

     文件       1210  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1\Properties\AssemblyInfo.cs

     文件       2892  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1\Properties\Resources.Designer.cs

     文件       5612  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1\Properties\Resources.resx

     文件       1102  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1\Properties\Settings.Designer.cs

     文件        249  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1\Properties\Settings.settings

     文件       3329  2010-03-24 12:37  SendKeys发送组合键\WindowsApplication1\WindowsApplication1.csproj

     文件        946  2010-03-24 12:34  SendKeys发送组合键\WindowsApplication1.sln

     文件      18432  2010-03-24 13:14  SendKeys发送组合键\WindowsApplication1.suo

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1\obj\Debug\TempPE

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1\bin\Debug

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1\obj\Debug

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1\bin

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1\obj

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1\Properties

     目录          0  2010-05-03 22:37  SendKeys发送组合键\WindowsApplication1

............此处省略4个文件信息

评论

共有 条评论