This repository has been archived by the owner on Jun 20, 2021. It is now read-only.
ThunderBirdTray cannot find the main window when used with a Chinese version of Thunderbird #19
Labels
bug
Something isn't working
I use the ThunderbirdTray with a Chinese version of Thunderbird, but it doesn't work all the times. I found that it did not work when the title of the main window of Thunderbird contained Chinese characters while it worked well when the title consisted of pure ASCII chars. After debugging the source, the problem was found on the capacity of windowTextBuilder in the lambda expression in the call of the EnumWindows function. I guess that StringBuilder counts the capacity by 1-byte char so that a chinese character is counted as 2 while GetWindowTextLength treats it as 1 character. So windowTextBuilder with capacity of length + 1 is always not long enough to save the title containing Chinese characters. The new program I compiled myself with length + 5 instead works well now.
The text was updated successfully, but these errors were encountered: