This is my function
and this is the line of code i haveCode:Public Function GetText(ByRef Get_hWnd As Integer) As String 'Dim retVal As Integer Dim lenTxt As Short Dim retText As String lenTxt = SendMessageLong(Get_hWnd, WM_GETTEXTLENGTH, 0, 0) retText = New String(" ", lenTxt + 1) Call SendMessageByString(Get_hWnd, WM_GETTEXT, lenTxt + 1, retText) GetText = Left(retText, lenTxt) End Function
This is supposed to get information of an window that appears after right clicking on a person but i get Index was outside the bounds of the array error on SplitSplit = Split(splitArr(3), Chr(10))Code:Dim click_Renamed As Short Dim SplitSplit() As String Dim TheUsername As String Dim splitArr() As String Dim TheText As String Dim intCount As Short lngHandles = FindWindow("#32770", "Window") If lngHandles = 0 Then Exit Sub lngHandle = FindWindowEx(lngHandles, 0&, "Static", vbNullString) strText = GetText(lngHandle) lngHandleButton = FindWindowEx(lngHandles, 0, "Button1", vbNullString) splitArr = Split(strText, Chr(9)) intCount = UBound(splitArr) SplitSplit = Split(splitArr(3), Chr(10)) TheUsername = Trim(SplitSplit(0)) TheText = splitArr(intCount) My.Computer.Clipboard.Clear() If optGetID.Checked = True Then My.Computer.Clipboard.SetText(TheText) ElseIf optGetPerson.Checked = True Then My.Computer.Clipboard.SetText(TheUsername) Else MsgBox("Choose it first") End If click_Renamed = SendMessage(lngHandleButton, WM_KEYDOWN, VK_SPACE, 0) 'sends a left button down click_Renamed = SendMessage(lngHandleButton, WM_KEYUP, VK_SPACE, 0) 'sends a left button up End Sub
Anyone can help ?
thanks in advance




Reply With Quote