Example:

  1. Declare Function GetFocus Lib "User" () As Integer

    Declare Function GetWindowText Lib "User" (ByVal hWnd%, ByVal Mess$, ByVal cbMax%) As _ Integer

     

    Sub Main

    1. Dim hWindow%

      Dim str1 As String *51

      Dim str2 As String * 25

      hWindow% = GetFocus()

      print "GetWindowText returned: ", GetWindowText( hWindow%, str1,51 )

      print "GetWindowText2 returned: ", GetWindowText( hWindow%, str2, 25)

      print str1

      print str2

       

    End Sub