📄 f_srf.frm
字号:
VERSION 5.00
Object = "{3A6644DE-3402-11D9-9DE7-C33FAA87690A}#1.0#0"; "WinXPCEngine.ocx"
Begin VB.Form F_SRF
BorderStyle = 3 'Fixed Dialog
Caption = "选择输入法"
ClientHeight = 3150
ClientLeft = 45
ClientTop = 330
ClientWidth = 4935
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3150
ScaleMode = 0 'User
ScaleWidth = 4935
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 855
Left = 0
ScaleHeight = 855
ScaleWidth = 4935
TabIndex = 2
Top = 0
Width = 4935
Begin VB.Image Image1
Height = 750
Left = 240
Picture = "F_SRF.frx":0000
Top = 60
Width = 750
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = " 请选择您所偏爱的输入法作为此系统文本的默认输入法;如果选择栏里没有你所偏爱的输入法,请手工安装。"
Height = 735
Left = 1320
TabIndex = 3
Top = 120
Width = 3375
End
End
Begin WinXPC_Engine.WindowsXPC WindowsXPC1
Left = 600
Top = 3240
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 3360
TabIndex = 1
Top = 2640
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "F_SRF.frx":1DF2
Left = 960
List = "F_SRF.frx":1DF4
TabIndex = 0
Top = 1560
Width = 3015
End
Begin VB.Line Line4
BorderColor = &H80000005&
X1 = 120
X2 = 4800
Y1 = 2535
Y2 = 2535
End
Begin VB.Line Line3
BorderColor = &H80000001&
X1 = 120
X2 = 4800
Y1 = 2520
Y2 = 2520
End
End
Attribute VB_Name = "F_SRF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetKeyboardLayoutList Lib "user32" (ByVal nBuff As Long, _
lpList As Long) As Long
Private Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" _
(ByVal pwszKLID As String) As Long
Private Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Private Declare Function ImmGetDescription Lib "imm32.dll" Alias "ImmGetDescriptionA" (ByVal _
hkl As Long, ByVal lpsz As String, ByVal uBufLen As Long) As Long
Private Declare Function ActivateKeyboardLayout Lib "user32" (ByVal hkl As Long, ByVal _
flags As Long) As Long
Const IME_CONFIG_GENERAL = 1
Const KLF_REORDER = &H8
Const KLF_ACTIVATE = &H1
Dim la(1 To 16) As Long
Dim ActIme As Long
Private Sub Combo1_Click()
ActIme = la(Combo1.ListIndex + 1)
Debug.Print ActIme
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc(vbCr) Then
If F_SRF.Combo1.ListCount > 0 Then
ActivateKeyboardLayout ActIme, 1
End If
Command1_Click
End If
End Sub
Private Sub Combo1_LostFocus()
If F_SRF.Combo1.ListCount > 0 Then
ActivateKeyboardLayout ActIme, 1
End If
End Sub
Private Sub Command1_Click()
F_MAIN.Show
Unload Me
End Sub
Private Sub Form_Load()
WindowsXPC1.InitSubClassing '加载XP控件
Dim astr As String * 256
Dim bstr As String
Dim x, hMem, I As Long
x = GetKeyboardLayoutList(32, la(1))
Combo1.Clear
If x Then
For I = 1 To x
ImmGetDescription la(I), astr, 256
If InStr(astr, Chr(0)) = 1 Then
bstr = ""
Else
bstr = Left$(astr, InStr(astr, Chr(0)))
End If
If Trim(bstr) = "" Then
Combo1.AddItem "英语(美国)"
Else
Combo1.AddItem bstr
End If
Next I
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -