描述
The EditWordBreakProcEx function is an application defined–callback function used with the EM_SETWORDBREAKPROCEX message. It determines the character index of the word break or the character class and word-break flags of the characters in the specified text. The EDITWORDBREAKPROCEX type defines a pointer to this callback function. EditWordBreakProcEx is a placeholder for the application-defined function name.
C/C++ 语法
LONG EditWordBreakProcEx( char *pchText, LONG cchText, BYTE bCharSet, INT code ); |
FreeBasic Declaration
FUNCTION EditWordBreakProcEx CDECL ( BYVAL pchText AS ZTRING PTR, _ BYVAL cchText AS LONG, _ BYVAL bCharSet AS UBYTE, _ BYVAL code AS INT_ _ ) AS LONG |
参数
pchText |
[in] Pointer to the text at the current position. If code specifies movement to the left, the text is in the elements pchText [–1] through pchText [-cchText], and pchText[0] is undefined. For all other actions, the text is in the elements pchText[0] through pchText[ cchText–1]. |
cchText |
[in] Number of characters in the buffer in the direction specified by code. |
bCharset |
[in] Character set of the text. |
code |
[in] The action to be taken by the callback function. This parameter can be one of the following values.
WB_CLASSIFY Retrieves the character class and word break flags of the character at the specified position. This value is for use with rich edit controls. WB_ISDELIMITER Checks whether the character at the specified position is a delimiter. WB_LEFT Finds the beginning of a word to the left of the specified position. WB_LEFTBREAK Finds the end-of-word delimiter to the left of the specified position. This value is for use with rich edit controls. WB_MOVEWORDLEFT Finds the beginning of a word to the left of the specified position. This value is used during CTRL+LEFT key processing. This value is for use with rich edit controls. WB_MOVEWORDRIGHT Finds the beginning of a word to the right of the specified position. This value is used during CTRL+RIGHT key processing. This value is for use with rich edit controls. WB_RIGHT Finds the beginning of a word to the right of the specified position. This is useful in right-aligned edit controls. WB_RIGHTBREAK Finds the end-of-word delimiter to the right of the specified position. This is useful in right-aligned edit controls. This value is for use with rich edit controls. |
Return Value
The function returns a value based on the code parameter.
code parameter |
返回值 |
WB_CLASSIFY |
Returns the character class and word-break flags of the character at the specified position. |
WB_ISDELIMITER |
Returns TRUE if the character at the specified position is a delimiter or FALSE if the character is not. |
All other values |
Returns the character index of the word break. |
备注
An application must install the callback function by specifying the address of the callback function in an EM_SETWORDBREAKPROCEX message.
For Microsoft Rich Edit 2.0 and later, Rich Edit no longer supports EditWordBreakProcEx. Users can send EM_SETWORDBREAKPROC to set EditWordBreakProc, which is now enhanced to support the passing of Unicode text.
最低操作系统
Windows 95, Windows NT 4.0.