VB设置活动窗口的输入法:例用vb控制记事本的输入法为英文,如果为中文就...
发布网友
发布时间:2024-10-23 20:22
我来回答
共2个回答
热心网友
时间:2024-11-02 15:00
我用Timer1设为200就是英文,你在控制记事本的时候,直接call Timer1_Timer里的程式
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 Timer1_Timer()
ActIme = "134481924"
ActivateKeyboardLayout ActIme, 1
End Sub
热心网友
时间:2024-11-02 15:01
dim a() as integer
p=inputbox("Input data:")
if p<0 then msgbox("no data!!!!!!!!!"):exit sub
do
i=i+1
redim preserve a(i-1)
a(i-1)=p
p=inputbox("Input data:")
loop until p<0
for l=0 to i-1
s=s+a(l)
next l
ave=s/(i-1)
for l=0 to i-1
if a(l)<ave then flag=flag+1
next
msgbox