// Retrieve an accessibility object IAccessible* obj = GetAccessibleObjectFromWindow(hwnd); // Retrieve the hyperlinked text content of the object BSTR text = AccessibleWrap::AsHyperText(obj); // Display the text in a label control SetWindowText(labelHandle, text);
// Retrieve an accessibility object IAccessible* obj = GetFocusedAccessibleObject(); // Retrieve the hyperlinked text content of the object BSTR text = AccessibleWrap::AsHyperText(obj); // Prompt the user to follow the link int result = MessageBox(NULL, text, L"Accessibility Link", MB_OKCANCEL); // If the user clicks OK, open the link in a web browser if (result == IDOK) { ShellExecute(NULL, L"open", text, NULL, NULL, SW_SHOWNORMAL); }In this example, the GetFocusedAccessibleObject function is used to retrieve the accessibility object associated with the currently focused component. The AsHyperText method is then used to retrieve the text content of the object as a hyperlinked string, which is then displayed to the user in a message box. If the user clicks OK, the link is opened in a web browser using the ShellExecute function. Based on the syntax and method names, AccessibleWrap is likely a custom library developed by the author of the code examples.