當前位置:成語大全網 - 英語詞典 - 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