| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 1033 人关注过本帖
标题:[转载]获取键盘信息
只看楼主 加入收藏
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
结帖率:100%
收藏
 问题点数:0 回复次数:0 
[转载]获取键盘信息
代码:
Option Explicit
Private Declare Function GetCaretBlinkTime Lib "user32" () As Long
Private Declare Function SystemParametersInfo& Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long)
Private Declare Function GetKeyboardType Lib "user32" (ByVal nTypeFlag As Long) As Long
Private Const spi_getkeyboardspeed = 10
Private Const spi_getkeyboarddelay = 22
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Dim ktype As String
Dim r As Long
Dim q As Long
Dim k As Long
k = GetKeyboardType(0)
Select Case k
Case 1
ktype = "IBM PC/XT 或兼容(83键)键盘"
Case 2
ktype = "Olivetti 102键键盘"
Case 3
ktype = "IBM PC/AT 或兼容(84键)键盘"
Case 4
ktype = "IBM增强(101或102)键盘"
Case 5
ktype = "Nokia 1050和类似键盘"
Case 6
ktype = "Nokia 9140和类似键盘"
Case 7
ktype = "Japanese键盘"
End Select
Label1.Caption = "键盘类型:" & ktype
q = SystemParametersInfo&(spi_getkeyboarddelay, 0, r, 0)
Label2.Caption = "键盘延迟时间:" & r & "秒"
q = SystemParametersInfo&(spi_getkeyboardspeed, 0, r, 0)
Label3.Caption = "键盘重复速度:" & " 每秒 " & r & " 次"
Timer1.Interval = GetCaretBlinkTime
Label4.Caption = "光标闪烁速度:" & GetCaretBlinkTime & "毫秒"
End Sub
Private Sub Timer1_Timer()
Line1.Visible = Not Line1.Visible
End Sub

[此贴子已经被作者于2007-3-1 20:11:45编辑过]


其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2007-03-01 19:29
快速回复:[转载]获取键盘信息
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015000 second(s), 9 queries.
Copyright©2004-2025, BC-CN.NET, All Rights Reserved