是不是这个:复制下列内容到记事本。保存为相应文件
EXAMPLE43.VBP
====================================================================
Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\PWIN98\SYSTEM\stdole2.tlb#OLE Automation
Module=Module1; Module1.bas
IconForm="Form1"
Startup="Form1"
ExeName32="example43.exe"
Command32=""
Name="工程1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Wondersoft"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
Module1.bas
====================================================================
Attribute VB_Name = "Module1"
Public Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Public Declare Function GetKeyboardLayoutList Lib "user32" (ByVal nBuff As Long, lpList As Long) As Long
Public Declare Function ImmIsIME Lib "imm32.dll" (ByVal HKL As Long) As Long
Public Declare Function ImmGetDescription Lib "imm32.dll" Alias "ImmGetDescriptionA" (ByVal HKL As Long, ByVal lpsz As String, ByVal uBufLen As Long) As Long
Public Declare Function ActivateKeyboardLayout Lib "user32" (ByVal HKL As Long, ByVal flags As Long) As Long
Public Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long
Public Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
Form1.frm
====================================================================
VERSION 5.00
Begin VB.Form Form1
Caption = "输入法"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 1815
Left = 240
TabIndex = 2
Text = "http://zmhh.mycool.net"
Top = 1200
Width = 3975
End
Begin VB.ComboBox Combo1
Height = 315
Left = 2040
TabIndex = 1
Top = 120
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "改变输入法"
Height = 375
Left = 2760
TabIndex = 0
Top = 600
Width = 1335
End
Begin VB.Label Label1
Caption = "选择输入法"
Height = 375
Left = 240
TabIndex = 3
Top = 120
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const KLF_REORDER = &H8
Private NoOfKBDLayout As Long, i As Long, j As Long
Private hKB(24) As Long, BuffLen As Long
Private Buff As String
Private RetStr As String
Private RetCount As Long
Private kln As StringPrivate Sub Command1_Click()
If Combo1.ListIndex = -1 Then
'如果用户尚未选择输入法,显示出错信息。
MsgBox "请选择一个输入法"
Exit Sub
End If
'改变输入法顺序。
kln = String(8, 0)
ActivateKeyboardLayout hKB(Combo1.ListIndex), 0
'LoadKeyboardLayout可以改变输入法顺序,第一个参数为输入法名称。
'GetKeyboardLayoutName可以获得输入法名称。
'ActivateKeyboardLayout设置当前输入法。
res = GetKeyboardLayoutName(kln)
curkeylayout = LoadKeyboardLayout(kln, KLF_REORDER)
ActivateKeyboardLayout curkeylayout, 0
End SubPrivate Sub Form_Load()
Buff = String(255, 0)
'取得目前得输入法。
curkeylayout = GetKeyboardLayout(0)
'取得所有输入法。
NoOfKBDLayout = GetKeyboardLayoutList(25, hKB(0))
For i = 1 To NoOfKBDLayout
If ImmIsIME(hKB(i - 1)) = 1 Then '中文输入法
BuffLen = 255
RetCount = ImmGetDescription(hKB(i - 1), Buff, BuffLen)
RetStr = Left(Buff, RetCount)
Combo1.AddItem RetStr
Else
RetStr = "english(american)" '英文输入法
Combo1.AddItem RetStr
End If
Next
'回复原来得输入法。
ActivateKeyboardLayout curkeylayout, 0
End Sub
EXAMPLE43.VBP
====================================================================
Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\PWIN98\SYSTEM\stdole2.tlb#OLE Automation
Module=Module1; Module1.bas
IconForm="Form1"
Startup="Form1"
ExeName32="example43.exe"
Command32=""
Name="工程1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Wondersoft"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
Module1.bas
====================================================================
Attribute VB_Name = "Module1"
Public Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Public Declare Function GetKeyboardLayoutList Lib "user32" (ByVal nBuff As Long, lpList As Long) As Long
Public Declare Function ImmIsIME Lib "imm32.dll" (ByVal HKL As Long) As Long
Public Declare Function ImmGetDescription Lib "imm32.dll" Alias "ImmGetDescriptionA" (ByVal HKL As Long, ByVal lpsz As String, ByVal uBufLen As Long) As Long
Public Declare Function ActivateKeyboardLayout Lib "user32" (ByVal HKL As Long, ByVal flags As Long) As Long
Public Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long
Public Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
Form1.frm
====================================================================
VERSION 5.00
Begin VB.Form Form1
Caption = "输入法"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 1815
Left = 240
TabIndex = 2
Text = "http://zmhh.mycool.net"
Top = 1200
Width = 3975
End
Begin VB.ComboBox Combo1
Height = 315
Left = 2040
TabIndex = 1
Top = 120
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "改变输入法"
Height = 375
Left = 2760
TabIndex = 0
Top = 600
Width = 1335
End
Begin VB.Label Label1
Caption = "选择输入法"
Height = 375
Left = 240
TabIndex = 3
Top = 120
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const KLF_REORDER = &H8
Private NoOfKBDLayout As Long, i As Long, j As Long
Private hKB(24) As Long, BuffLen As Long
Private Buff As String
Private RetStr As String
Private RetCount As Long
Private kln As StringPrivate Sub Command1_Click()
If Combo1.ListIndex = -1 Then
'如果用户尚未选择输入法,显示出错信息。
MsgBox "请选择一个输入法"
Exit Sub
End If
'改变输入法顺序。
kln = String(8, 0)
ActivateKeyboardLayout hKB(Combo1.ListIndex), 0
'LoadKeyboardLayout可以改变输入法顺序,第一个参数为输入法名称。
'GetKeyboardLayoutName可以获得输入法名称。
'ActivateKeyboardLayout设置当前输入法。
res = GetKeyboardLayoutName(kln)
curkeylayout = LoadKeyboardLayout(kln, KLF_REORDER)
ActivateKeyboardLayout curkeylayout, 0
End SubPrivate Sub Form_Load()
Buff = String(255, 0)
'取得目前得输入法。
curkeylayout = GetKeyboardLayout(0)
'取得所有输入法。
NoOfKBDLayout = GetKeyboardLayoutList(25, hKB(0))
For i = 1 To NoOfKBDLayout
If ImmIsIME(hKB(i - 1)) = 1 Then '中文输入法
BuffLen = 255
RetCount = ImmGetDescription(hKB(i - 1), Buff, BuffLen)
RetStr = Left(Buff, RetCount)
Combo1.AddItem RetStr
Else
RetStr = "english(american)" '英文输入法
Combo1.AddItem RetStr
End If
Next
'回复原来得输入法。
ActivateKeyboardLayout curkeylayout, 0
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货