forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] Do not include string terminator in GetWindowText
WindowEnumerator::GetWindowText was including the trailing string terminator in the body of the returned string. This CL fixes that as well as makes several other changes: - WindowEnumeratorTest.EnumerateTopLevelWindows had the same bug in its independent implementation of GetWindowText. It is also fixed. - WindowEnumerator has been whittled down to a single function, so there's no need for a class anymore. It's now simply base::win::EnumerateChildWindows, which is a little easier to use. - base/win/window_enumerator.h no longer includes windows.h. - GetWindowText has been renamed to GetWindowTextString so that it doesn't accidentally get renamed to GetWindowTextW by windows.h. - GetWindowTextString also handles the case where the actual text is fewer characters than reported by GetWindowTextLength. MSDN explains a few cases where this could happen. Bug: 1482637 Change-Id: I8cb9b5706fb43bdb10e79afc9c832d9a4e5ee6af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4868390 Auto-Submit: Greg Thompson <[email protected]> Reviewed-by: S Ganesh <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/main@{#1197669}
- Loading branch information
Showing
5 changed files
with
69 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters