---
name: "SHTruncateString"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SHTruncateString"
---

# SHTruncateString(3w)

## NAME

**SHTruncateString** (SHLWAPI.162)

## SYNOPSIS

DWORD SHTruncateString\
  (\
   LPSTR *lpStr*,\
   DWORD *size*\
  )

## DESCRIPTION

Remove a hanging lead byte from the end of a string, if present.

## PARAMS

*lpStr* **\[In\]**  String to check for a hanging lead byte.

*size* **\[In\]**  Length of *lpStr*.

## RETURNS

**Success:** The new length of the string. Any hanging lead bytes are removed.

**Failure:** **0**, if any parameters are invalid.

## IMPLEMENTATION

Exported by ordinal only. Use **[GetProcAddress(3w)](/GetProcAddress/3w.md)** to obtain a pointer to the function.

Implemented in **"dlls/shlwapi/string.c"**.

Debug channel **"shell"**.
