Console-Docs
Console-Docs copied to clipboard
GetConsoleTitle documented behavior does not match what it does
[Enter feedback here] GetConsoleTitleA returns 0 if the returned string does not fit in the buffer. (This means you can't pass in an empty buffer to get the length of the string.) GetConsoleTitleA returns the length of the string not including the null terminator if it exactly fits in the buffer without the null terminator. (This means there is no null terminator at the end of the string for this case.) GetConsoleTitleA returns the length of the string not including the null terminator if the null terminator does fit into the buffer.
Behavior tested on Windows 10 Home
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: b94d010a-3995-8bce-8441-50a8594cf9a0
- Version Independent ID: 61bac61e-c4d3-b704-23aa-dc622cb1b8fa
- Content: GetConsoleTitle function - Windows Console
- Content Source: docs/getconsoletitle.md
- Product: console
- GitHub Login: @miniksa
- Microsoft Alias: miniksa