'textbox text limit
'   为一个文本框设置当前的文本长度限制，以字符为单位。
'   hWndControl: 控件的句柄 (例如  HWND_FORM1_TEXTBOX1)
Sub FF_TextBox_SetTextLimit (ByVal hWndControl as HWnd, _
                             ByVal MaxCharacters as Long)
    
    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then  
       ' Set the control's text limit
         SendMessageW hWndControl, EM_SETLIMITTEXT, MaxCharacters, 0
    End If  
    
End Sub

