成语大全网 - 汉语词典 - VB 屏幕取词

VB 屏幕取词

如果你装了金山词霸,可以这样

从“引用”中添加XdictGrb.dll

Option Explicit

Implements IXDictGrabSink

Private gp As GrabProxyPrivate Sub Form_Load()

Set gp = New GrabProxy

With gp

.GrabEnabled = True '是否有效

.GrabInterval = 30 '指定抓取时间间隔

.GrabMode = XDictGrabMouse '模式(鼠标是否加按键)

.AdviseGrab Me '接口指向自身End WithEnd SubPrivate Sub Form_Unload(Cancel As Integer)

Set gp = Nothing

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

Label1.Caption = "当前坐标:" & "(" & lCursorX & "," & lCursorY & ")"

Label2.Caption = "当前语句:" & SentenceString

Label3.Caption = "当前字符:" & Mid(SentenceString, lLoc + 1, 1000)

End Function