TE Edit Control Win32 / Win64 Help
Product page

TerInsertHyperlink

Insert hyperlink.

int TerInsertHyperlink(hWnd, text, code, PictId, repaint)
int TerInsertHyperlinkU(hWnd, UnicodeText, code, repaint)
HWND hWnd;The handle of the window to be accessed
LPBYTE text;The text phrase for the hyperlink.

The style and color for the hyperlink can be modified by changing the LinkStyle and LinkColor variables using the GetTerFields/SetTerFields function before inserting the hyperlink.

This parameter is ignored when the PictId parameter is non-zero.

LPWORD UnicodeText;The unicode text phrase for the hyperlink. This parameter is used only by the TerInsertHyperlinkU method.
LPBYTE code;The url or other information for the hyperlink. This information is not displayed on the screen.
int PictId;The picture id for the hyperlink if this a picture link. Set this parameter to 0 to insert text type hyperlink.
BOOL repaint;Repaint the window after this operation

Comment: Please note that the hyperlink cursor must be enabled using the ID_SHOW_HYPERLINK_CURSOR to show the hyperlink cursor.

Return Value: This function returns the font id or the picture id for the newly inserted hyperlink. It returns -1 to indicate an error condition.