It would be better to avoid duplicate GetWindowTextW() calls.
I thought a long time how to fix this, but i couldn't find another way than this one, because we need to find out whether or not the window title is empty, and afaik we can only do that by calling GetWindowText (again). If you have another way that i overlooked, please let me know
Regards Louis