VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text2 
      Height          =   975
      Left            =   1560
      MultiLine       =   -1  'True
      TabIndex        =   2
      Text            =   "EM_GETLINECOUNT.frx":0000
      Top             =   120
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   3360
      TabIndex        =   1
      Top             =   120
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   975
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   0
      Text            =   "EM_GETLINECOUNT.frx":0006
      Top             =   120
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
    ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    
Private Const EM_GETLINECOUNT = &HBA

Private Sub Command1_Click()
    Debug.Print SendMessage(Text1.hwnd, EM_GETLINECOUNT, 0&, 0&)
    Debug.Print SendMessage(Text2.hwnd, EM_GETLINECOUNT, 0&, 0&)
End Sub

Private Sub Form_Load()
    Dim N As Long
    
    ' 22 Hard Lines
    Text1.Text = vbNullString
    For N = 1 To 21
        Text1.Text = Text1.Text & N & vbCrLf
    Next N
    
    ' 22 Soft Lines
    Text2.Text = String(22 * 11, "A")
End Sub
