Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Locates the first occurrence of a null-terminated substring in a null-terminated string.

Header file:


Implemented by:


Called by:

Client applications and service providers

  LPCTSTR lpsz,
  LPCTSTR lpszKey


[in] Pointer to the null-terminated string to be searched. The lpsz parameter must not exceed 65536 characters.


[in] Pointer to the null-terminated substring to be searched for. The lpszKey parameter must not exceed 65536 characters.

SzFindSz returns a pointer to the first character of the first occurrence of the substring in the string. If the substring does not occur anywhere in the string, if lpszKey is larger than lpsz, or if either parameter is NULL, a value of NULL is returned.

The SzFindSz function searches for an exact match only; it is sensitive to case and diacritical differences. Searches in Unicode and DBCS formats are supported. The length limit on both parameters is in characters, not necessarily bytes.

© 2015 Microsoft