VERSION 5.00 Begin VB.Form FrmMain AutoRedraw = -1 'True Caption = "GetText" ClientHeight = 3090 ClientLeft = 60 ClientTop = 450 ClientWidth = 5340 LinkTopic = "Form1" ScaleHeight = 3090 ScaleWidth = 5340 StartUpPosition = 2 Begin VB.Timer Timer Interval = 10 Left = 360 Top = 600 End Begin VB.CommandButton cmdEx Caption = "Add" Height = 360 Left = 0 TabIndex = 3 Top = 0 Width = 615 End Begin VB.TextBox txtCOPY Height = 2415 Left = 0 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 1 Top = 360 Width = 5295 End Begin VB.Label lblCopyright Caption = "A Software by Steve: For Experimental Use ONLY! 2012.6" Height = 255 Left = 0 TabIndex = 2 Top = 2880 Width = 5055 End Begin VB.Label lblGET BackStyle = 0 'Transparent BorderStyle = 1 'Fixed Single Height = 420 Left = 600 TabIndex = 0 Top = 0 Width = 4650 End End Attribute VB_Name = "FrmMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Implements IXDictGrabSink Private gp As GrabProxy Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Declare Function GetActiveWindow Lib "user32" () As Long Private Sub cmdEx_Click() If lblGET.Caption = "" Then MsgBox "Please move your mouse pointer to the text you want to get to preview the text. If it is just the exact sentence you want, press ""Ctrl"" key or click on the ""Add"" button." & Chr(13) & Chr(13) & Chr(13) & "More questions? Contact me via e-mail: yzsqqc@google.com.cn", vbInformation, "A Steve Product" Else txtCOPY.Text = txtCOPY.Text & vbCrLf & lblGET.Caption End If End Sub Private Sub Form_Load() On Error GoTo ErrHandle Set gp = New GrabProxy With gp .GrabEnabled = True .GrabInterval = 5 .GrabMode = XDictGrabMouse 'XDictGrabMouseWithShift .AdviseGrab Me End With Exit Sub ErrHandle: Open "Reg.bat" For Append As #1 Print #1, "color 5e" Print #1, "copy XdictGrb.dll %windir%" & "\System32" Print #1, "@echo Windows Vista / 7 用户:如果稍后提示注册失败,请手动“以管理员身份运行” Reg.bat文件" Print #1, "pause" Print #1, "regsvr32 XdictGrb.dll" Close #1 Shell "Reg.bat" End Sub Private Sub Form_Resize() lblGET.Width = Me.Width - 620 txtCOPY.Width = Me.Width txtCOPY.Height = Me.Height - 1100 lblCopyright.Top = txtCOPY.Top + txtCOPY.Height End Sub Private Sub Form_Unload(Cancel As Integer) On Error Resume Next Kill "Reg.bat" End Sub Private Sub Timer_Timer() If GetKey() = "1" Then cmdEx_Click End Sub Private Function IXDictGrabSink_QueryWord(ByVal WordString As String, ByVal lCursorX As Long, ByVal lCursorY As Long, ByVal SentenceString As String, lLoc As Long, lStart As Long) As Long lblGET.Caption = SentenceString End Function Public Function GetKey() As String Dim AddKey As String If GetAsyncKeyState(17 )= -32767 Then GetKey = "1" End If End Function |
|