资源简介
C# USB HIF
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms; // required for Message
using System.Runtime.InteropServices; // required for Marshal
using System.IO;
using Microsoft.Win32.SafeHandles;
// DriveDetector - rev. 1 Oct. 31 2007
namespace Dolinay
{
///
/// Hidden Form which we use to receive Windows messages about flash drives
///
internal class DetectorForm : Form
{
private Label label1;
private DriveDetector mDetector = null;
///
/// Set up the hidden form.
///
/// DriveDetector object which will receive notification about USB drives see WndProc
public DetectorForm(DriveDetector detector)
{
mDetector = detector;
this.MinimizeBox = false;
this.MaximizeBox = false;
this.ShowInTaskbar = false;
this.ShowIcon = false;
this.FormBorderstyle = FormBorderstyle.None;
this.Load += new System.EventHandler(this.Load_Form);
this.Activated += new EventHandler(this.Form_Activated);
}
private void Load_Form(object sender EventArgs e)
{
// We don‘t really need this just to display the label in designer ...
InitializeComponent();
// Create really small form invisible anyway.
this.Size = new System.Drawing.Size(5 5);
}
private void Form_Activated(object sender EventArgs e)
{
this.Visible = false;
}
///
/// This function receives all the windows messages for this window (form).
/// We call the DriveDetector from here so that is can pick up the messages about
/// drives arrived and removed.
///
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (mDetector != null)
{
mDetector.WndProc(ref m);
}
}
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13 30);
this.label1.Name = “label1“;
this.label1.Size = new System.Drawing.Size(314 13);
this.label1.TabIndex = 0;
this.label1.Text = “This is invisible form. To see DriveDetector code click View Code“;
//
// DetectorForm
//
this.ClientSize = new System.Drawing.Size(360 80);
this.Controls.Add(this.label1);
this.Name = “DetectorForm“;
this.ResumeLayout(false);
this.PerformLayout();
}
} // class DetectorForm
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-27 06:33 HID-master\
文件 378 2017-03-27 06:33 HID-master\.gitattributes
文件 4884 2017-03-27 06:33 HID-master\.gitignore
文件 1021 2017-03-27 06:33 HID-master\HID.sln
目录 0 2017-03-27 06:33 HID-master\HID\
文件 2550 2017-03-27 06:33 HID-master\HID\ClassDiagram1.cd
文件 31686 2017-03-27 06:33 HID-master\HID\DriveDetector.cs
文件 14217 2017-03-27 06:33 HID-master\HID\Form1.Designer.cs
文件 4014 2017-03-27 06:33 HID-master\HID\Form1.cs
文件 219062 2017-03-27 06:33 HID-master\HID\Form1.resx
文件 6743 2017-03-27 06:33 HID-master\HID\HID.csproj
文件 463 2017-03-27 06:33 HID-master\HID\Program.cs
目录 0 2017-03-27 06:33 HID-master\HID\Properties\
文件 1314 2017-03-27 06:33 HID-master\HID\Properties\AssemblyInfo.cs
文件 2799 2017-03-27 06:33 HID-master\HID\Properties\Resources.Designer.cs
文件 5496 2017-03-27 06:33 HID-master\HID\Properties\Resources.resx
文件 1084 2017-03-27 06:33 HID-master\HID\Properties\Settings.Designer.cs
文件 242 2017-03-27 06:33 HID-master\HID\Properties\Settings.settings
文件 141 2017-03-27 06:33 HID-master\HID\app.config
文件 15759 2017-03-27 06:33 HID-master\HID\hid.cs
文件 28257 2017-03-27 06:33 HID-master\HID\hidAPI.cs
文件 64 2017-03-27 06:33 HID-master\README.md
- 上一篇:unity5圣典中文API手册v0.02.chm
- 下一篇:金额大小写转化
相关资源
- C#加载RAW、SMV图像数据转换为BMP
- C# 立马关机 代码
- C# 动态 时钟用户控件(基于System.Dr
- C#多线程以及Socket通讯
- 泛型(generic)是C#语言2.0和通用语言
- 三菱Q-PLC与C#串口
- C#与三菱Q系列PLC以太网通信
- C# usb hid 设备控制
- C#实现Spy++
- Unity 房间游览
- 寿星万年历的c#实现版本sxtwl_csharp_t
- TcpClient C#2010读取PLC
- C# 远程开机和关机
- C#实现特殊主框架界面效果
- C#会员管理条码版(附数据库)
- C#获取U盘信息
- C#教程(非常基础)
- C#打开与获取网页源码
- C# Cad2006二次开发之图形扩展属性读写
- C# 棋牌室小软件(附数据库以及源码
- c# 串口通讯的(收发数据)
- C#-与西门子1200-1500-S7通讯(源码+文档
- C# 朗读文本文字(SpeechSynthesizer)
- C#_基础教程笔记(传智播客)-苏坤
- C#联合halcon实现鼠标滚轮事件
- C# 异型窗口,圆形窗口
- CSharp language specification 5.0中文(C# 语
- asp.netc#开发规范
- C# 固高运动卡(gts.dll)
- C#写的文件读写
评论
共有 条评论