- Код: Выделить всё
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" ( _
ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias _
"GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
'Const GW_HWNDFIRST = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rc As Long
Dim tekst As String
tekst = Space(GetWindowTextLength(Me.Handle.ToInt32))
rc = GetWindowText(Me.Handle.ToInt32, tekst, Len(tekst))
ListBox1.Items.Insert(ListBox1.Items.Count, tekst)
End Sub
когда получаю длину заголовка число оказывается слишком большим чтоб такую строку инициализировать... как быть?
и ещё: есть ли аналог "функции" string() из 6-ого басика?
спасиба.