Dim builder As New System.Text.StringBuilder GetWindowText(hwnd, builder, 256) Me.ListBox1.Items.Add(builder.ToString)
That is unrelated to the GetWindowText call, unless you have the situation described below, which would be very weird:After that I got no compilation errors but the program stops responding and windows asks to shut it down!
documentation said:However, if the target window is not responding and it belongs to the calling application, GetWindowText will cause the calling application to become unresponsive.