引用
Option Explicit
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub about_Click()
Me.Hide
Dialog.Show 0
End Sub
Private Sub Form_Load()
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3
Me.Caption = "密保卡速查2.0"
Label3.Caption = "当前系统时间:" & Time
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub sj_Click()
Me.Hide
Form3.Show 1
End Sub
Private Sub SJ2_Click()
Me.Hide
Form4.Show 1
End Sub
Private Sub Text1_Click()
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text2_Click()
Text2.SelLength = Len(Text2.Text)
End Sub
Private Sub Text4_Click()
Text3.SelLength = Len(Text3.Text)
End Sub
Private Sub Timer1_Timer()
Label3.Caption = "当前系统时间:" & Time
End Sub
Private Sub Text1_Change()
If Len(Text1.Text) = 2 Then
Text2.SetFocus
Text2.SelLength = Len(Text2.Text)
mmm (Text1.Text)
End If
Test
Text4.Text = Right(Text4.Text, 2)
End Sub
Private Sub Text1_LostFocus()
Text1.Text = UCase(Text1.Text)
End Sub
Private Sub Text2_Change()
If Len(Text2.Text) = 2 Then
Text3.SetFocus
Text3.SelLength = Len(Text3.Text)
mmm (Text2.Text)
ElseIf Len(Text2.Text) = 0 Then
Text1.SetFocus
Text1.SelLength = Len(Text1.Text)
End If
Test
End Sub
Private Sub Text2_LostFocus()
Text2.Text = UCase(Text2.Text)
End Sub
Private Sub Text3_LostFocus()
Text3.Text = UCase(Text3.Text)
End Sub
Private Sub Text3_Change()
If Len(Text3.Text) = 2 Then
Text1.SetFocus
Text1.SelLength = Len(Text1.Text)
mmm (Text3.Text)
ElseIf Len(Text3.Text) = 0 Then
Text2.SetFocus
Text2.SelLength = Len(Text2.Text)
End If
Test
End Sub
Public Sub Test()
If Len(Text1.Text) = 0 Then
Text4.Text = ""
End If
End Sub
Private Sub mmm(ByVal txt As String)
Dim mb As String
If Option1.Value = True Then
mb = "密保1"
Else
mb = "密保2"
End If
Call Xm
If txt = "A1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A1", App.Path & "\set.dat")
ElseIf txt = "A2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A2", App.Path & "\set.dat")
ElseIf txt = "A3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A3", App.Path & "\set.dat")
ElseIf txt = "A4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A4", App.Path & "\set.dat")
ElseIf txt = "A5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A5", App.Path & "\set.dat")
ElseIf txt = "A6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A6", App.Path & "\set.dat")
ElseIf txt = "A7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A7", App.Path & "\set.dat")
ElseIf txt = "A8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "A8", App.Path & "\set.dat")
End If
'------------------------ b
If txt = "B1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B1", App.Path & "\set.dat")
ElseIf txt = "B2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B2", App.Path & "\set.dat")
ElseIf txt = "B3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B3", App.Path & "\set.dat")
ElseIf txt = "B4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B4", App.Path & "\set.dat")
ElseIf txt = "B5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B5", App.Path & "\set.dat")
ElseIf txt = "B6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B6", App.Path & "\set.dat")
ElseIf txt = "B7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B7", App.Path & "\set.dat")
ElseIf txt = "B8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "B8", App.Path & "\set.dat")
End If
'------------------------- c
If txt = "C1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C1", App.Path & "\set.dat")
ElseIf txt = "C2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C2", App.Path & "\set.dat")
ElseIf txt = "C3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C3", App.Path & "\set.dat")
ElseIf txt = "C4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C4", App.Path & "\set.dat")
ElseIf txt = "C5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C5", App.Path & "\set.dat")
ElseIf txt = "C6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C6", App.Path & "\set.dat")
ElseIf txt = "C7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C7", App.Path & "\set.dat")
ElseIf txt = "C8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "C8", App.Path & "\set.dat")
End If
'------------------------- d
If txt = "D1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D1", App.Path & "\set.dat")
ElseIf txt = "D2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D2", App.Path & "\set.dat")
ElseIf txt = "D3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D3", App.Path & "\set.dat")
ElseIf txt = "D4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D4", App.Path & "\set.dat")
ElseIf txt = "D5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D5", App.Path & "\set.dat")
ElseIf txt = "D6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D6", App.Path & "\set.dat")
ElseIf txt = "D7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D7", App.Path & "\set.dat")
ElseIf txt = "D8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "D8", App.Path & "\set.dat")
End If
'------------------------- e
If txt = "E1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E1", App.Path & "\set.dat")
ElseIf txt = "E2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E2", App.Path & "\set.dat")
ElseIf txt = "E3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E3", App.Path & "\set.dat")
ElseIf txt = "E4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E4", App.Path & "\set.dat")
ElseIf txt = "E5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E5", App.Path & "\set.dat")
ElseIf txt = "E6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E6", App.Path & "\set.dat")
ElseIf txt = "E7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E7", App.Path & "\set.dat")
ElseIf txt = "E8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "E8", App.Path & "\set.dat")
End If
'------------------------ f
If txt = "F1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F1", App.Path & "\set.dat")
ElseIf txt = "F2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F2", App.Path & "\set.dat")
ElseIf txt = "F3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F3", App.Path & "\set.dat")
ElseIf txt = "F4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F4", App.Path & "\set.dat")
ElseIf txt = "F5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F5", App.Path & "\set.dat")
ElseIf txt = "F6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F6", App.Path & "\set.dat")
ElseIf txt = "F7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F7", App.Path & "\set.dat")
ElseIf txt = "F8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "F8", App.Path & "\set.dat")
End If
'------------------------ g
If txt = "G1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G1", App.Path & "\set.dat")
ElseIf txt = "G2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G2", App.Path & "\set.dat")
ElseIf txt = "G3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G3", App.Path & "\set.dat")
ElseIf txt = "G4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G4", App.Path & "\set.dat")
ElseIf txt = "G5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G5", App.Path & "\set.dat")
ElseIf txt = "G6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G6", App.Path & "\set.dat")
ElseIf txt = "G7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G7", App.Path & "\set.dat")
ElseIf txt = "G8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "G8", App.Path & "\set.dat")
End If
'------------------------ h
If txt = "H1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H1", App.Path & "\set.dat")
ElseIf txt = "H2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H2", App.Path & "\set.dat")
ElseIf txt = "H3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H3", App.Path & "\set.dat")
ElseIf txt = "H4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H4", App.Path & "\set.dat")
ElseIf txt = "H5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H5", App.Path & "\set.dat")
ElseIf txt = "H6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H6", App.Path & "\set.dat")
ElseIf txt = "H7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H7", App.Path & "\set.dat")
ElseIf txt = "H8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "H8", App.Path & "\set.dat")
End If
'------------------------ i
If txt = "I1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I1", App.Path & "\set.dat")
ElseIf txt = "I2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I2", App.Path & "\set.dat")
ElseIf txt = "I3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I3", App.Path & "\set.dat")
ElseIf txt = "I4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I4", App.Path & "\set.dat")
ElseIf txt = "I5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I5", App.Path & "\set.dat")
ElseIf txt = "I6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I6", App.Path & "\set.dat")
ElseIf txt = "I7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I7", App.Path & "\set.dat")
ElseIf txt = "I8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "I8", App.Path & "\set.dat")
End If
'------------------------ j
If txt = "J1" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J1", App.Path & "\set.dat")
ElseIf txt = "J2" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J2", App.Path & "\set.dat")
ElseIf txt = "J3" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J3", App.Path & "\set.dat")
ElseIf txt = "J4" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J4", App.Path & "\set.dat")
ElseIf txt = "J5" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J5", App.Path & "\set.dat")
ElseIf txt = "J6" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J6", App.Path & "\set.dat")
ElseIf txt = "J7" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J7", App.Path & "\set.dat")
ElseIf txt = "J8" Then
Text4.Text = Text4.Text & "," & GetIni(mb, "J8", App.Path & "\set.dat")
End If
Call Jm
End Sub