=Everything_GetResultHighlightedFileName=
The '''Everything_GetResultHighlightedFileName''' function retrieves the highlighted file name part of the visible result.

==Syntax==
<pre>
LPCTSTR Everything_GetResultHighlightedFileName(
    int index
);
</pre>

==Parameters==
<dl>
;''index''
Zero based index of the visible result.
</dl>

==Return Value==
The function returns a pointer to a null terminated string of '''TCHARs'''.
If the function fails the return value is NULL. To get extended error information, call [[support/everything/SDK/Everything_GetLastError|Everything_GetLastError]].

{|
! Error code
! Meaning
|-
| EVERYTHING_ERROR_INVALIDCALL
| Call [[support/everything/SDK/Everything_Query|Everything_Query]] before calling Everything_GetResultHighlightedFileName.
|-
| EVERYTHING_ERROR_INVALIDREQUEST
| Highlighted file name information was not requested or is unavailable, Call [[support/everything/SDK/Everything_SetRequestFlags|Everything_SetRequestFlags]] with EVERYTHING_REQUEST_DATE_HIGHLIGHTED_FILE_NAME before calling [[support/everything/SDK/Everything_Query|Everything_Query]].
|-
| EVERYTHING_ERROR_INVALIDINDEX
| index must be greater than or equal to 0 and less than the visible number of results.
|}

==Remarks==
The ANSI / Unicode version of this function must match the ANSI / Unicode version of the call to [[support/everything/SDK/Everything_Query|Everything_Query]].
The function returns a pointer to an internal structure that is only valid until the next call to [[support/everything/SDK/Everything_Query|Everything_Query]] or [[support/everything/SDK/Everything_Reset|Everything_Reset]].
You can only call this function for a visible result. To determine if a result is visible use the [[support/everything/SDK/Everything_GetNumFileResults|Everything_GetNumFileResults]] function.
Text inside a * quote is highlighted, two consecutive *'s is a single literal *.
For example, in the highlighted text: abc *123* the 123 part is highlighted.

==Example==
<pre>
// set the search text to abc AND 123
Everything_SetSearch("abc 123");

// execute the query
Everything_Query(TRUE);

// Get the highlighted file name of the first visible result.
LPCTSTR lpHighlightedFileName = Everything_GetResultHighlightedFileName(0);
</pre>

==Function Information==
Requires Everything 1.4.1 or later.

==See Also==
<ul>
*[[support/everything/SDK/Everything_Query|Everything_Query]]
*[[support/everything/SDK/Everything_Reset|Everything_Reset]]
*[[support/everything/SDK/Everything_SetRequestFlags|Everything_SetRequestFlags]]
</ul>
