Compartilhar via


EM_LIMITTEXT

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This message limits the amount of text the user can enter into an edit control.

Syntax

EM_LIMITTEXT 
    wParam = (WPARAM) cchMax; 
    lParam = 0;

Parameters

  • cchMax
    Specifies the maximum number of characters the user can enter. If this parameter is zero, the text length is set to 0x7FFE (32,766) characters for single-line edit controls or 0xFFFF (65,535) characters for multiline edit controls. If this parameter is not zero, the maximum text length is 0x7FFE characters for single-line edit controls or 0x7FFFFFFE characters for multiline edit controls. These limits differ from the limits for Windows-based desktop platforms.
  • lParam
    Not used; set to 0.

Return Value

None.

Remarks

When you create an edit control, the amount of text a user can enter in the control is initially limited to 30,000 characters. Use EM_LIMITTEXT to change this limit.

If cchMax is set to -1, the multiline edit control limit is 0x7FFFFFFE.

The EM_LIMITTEXT message limits only the text the user can enter. This message has no effect on any text already in the edit control when the message is sent, nor does EM_LIMITTEXT affect the length of the text copied to the edit control by the WM_SETTEXT message. If an application uses the WM_SETTEXT message to place more text into an edit control than is specified in the EM_LIMITTEXT message, the user can edit the entire contents of the edit control.

Requirements

Header windows.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

WM_SETTEXT
Edit Boxes Messages