How can I translate this to vb.net?
I have tried a lot, and basicly I'm stuck at passing the txt variable to sendmessage, since this needs to be an intptr apparently..
thanx
I have tried a lot, and basicly I'm stuck at passing the txt variable to sendmessage, since this needs to be an intptr apparently..
Code:
Public Function WindowText(window_hwnd As Long) As String
Dim txtlen As Long
Dim txt As String
WindowText = ""
If window_hwnd = 0 Then Exit Function
txtlen = SendMessage(window_hwnd, WM_GETTEXTLENGTH, 0, 0)
If txtlen = 0 Then Exit Function
txtlen = txtlen + 1
txt = Space$(txtlen)
txtlen = SendMessage(window_hwnd, WM_GETTEXT, txtlen, ByVal txt)
WindowText = Left$(txt, txtlen)
If WindowText = "MOHAA Console" Then
WindowText = ""
ElseIf WindowText = "copy" Then
WindowText = ""
ElseIf WindowText = "quit" Then
WindowText = ""
ElseIf WindowText = "clear" Then
WindowText = ""
End If
findstring$ = WindowText
FindText TargetPosition + 1
End Function
Comment