Hallo, ich bin schon lange am basteln…
Ich begreif aber nicht was ich falsch mache…
Mein Programm soll eine textstring in ein Javafenster senden…
schaut euch bitte meinen Code an, vielleicht kann mir jemand von euch helfen!
Public Class Form1
Declare Auto Function FindWindow Lib „user32“ (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Declare Auto Function FindWindowEx Lib „user32“ (ByVal hWnd1 As IntPtr, _
ByVal hWnd2 As IntPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As IntPtr
Declare Function SendMessageByString Lib „user32“ Alias „SendMessageA“ (ByVal hwnd As IntPtr, _
ByVal uMsg As Int32, ByVal wParam As IntPtr, ByVal lParam As String) As Integer
Const WM_SETTEXT As Int32 = &HC
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hwnd As IntPtr
Dim Child As IntPtr
hwnd = FindWindow(„SunAwtCanvas“, TextBox1.Text())
Child = FindWindowEx(hwnd, 0, „Edit“, „“)
Child = FindWindowEx(Child, 0, „Edit“, „“)
If hwnd IntPtr.Zero Then
Dim txt As String = „Guten Tag“
SendMessageByString(FindWindowEx(hwnd, IntPtr.Zero, Nothing, Nothing), WM_SETTEXT, IntPtr.Zero, txt)
End If
End Sub
Das Problem ist, dass wenn ich auf Button klicke passiert nix…
Was hab ich falsch gemacht ? .__.