TE Edit Control Win32 / Win64 Help
Product page

TerGetWordCount

Count number of words in the document.

long TerGetWordCount(hWnd, flags)
HWND hWnd;Handle of the window to be accessed
UINT flags;The flag can be one or more of the following bits:
WC_SELECTION:Scan only the selected text. If a text block is not highlighted or if the WC_SELECTION bit is not specified, then the entire document will be scanned.
WC_INCLUDE_HIDDEN:Count the hidden words also.
WC_INCLUDE_HDR_FTR:Count the words in the header/footer area also.

Return Value: This function returns the number of words counted. It returns -1 to indicate an error condition.