Before creating SysLink controls, call InitCommonControlsEx, specifying the ICC_LINK_CLASS.
To create a SysLink, call CreateWindow or CreateWindowEx, specifying the WC_LINK window class. The lpWindowName parameter common to these functions specifies a pointer to a zero-terminated string containing the marked-up text to display. For window styles particular to SysLink controls, see Syslink Control Styles.
All the new functionality defined in ComCtl32.dll version 6 supports only Unicode. Therefore, you cannot create ANSI versions of SysLink controls, only Unicode versions.
The following example function creates a SysLink that displays two links. The first is an URL, and the second is identified by an application-defined string. Specifying the WS_TABSTOP style ensures that the user will be able to select a link by tabbing to it and pressing the Enter key. It is assumed that InitCommonControlsEx has already been called.
The notifications associated with SysLink controls are NM_CLICK (syslink) and (for links that can be activated by the Enter key) NM_RETURN.
The following example shows how an application might process a notification that one of the links in the previous example has been clicked. If the notification is from the first link (index 0), the URL is opened in the default browser. If the notification is from the link that was identified as "idInfo" when the control was created, a message box is shown. The example is intended to show two different ways of identifying a link, and should not be taken as model code.