szWindowName doesn't actually correctly set the window name?

I've tried ripping apart all the window create stuff, and replaced with code from various sources, with differing degrees of success (some would name the app window correctly, but left me with an app that was overdrawn by the apps behind)
getting nowhere fast
any suggestions anyone?
(p.s the reason for wanting this to accurately set the name of the window is that I was trying to add a simple function to restore minimised app versions when the app is relaunched. something that is usually done with window names without any problems - hence finding that the window names were not working correctly)
getting nowhere fast

any suggestions anyone?
(p.s the reason for wanting this to accurately set the name of the window is that I was trying to add a simple function to restore minimised app versions when the app is relaunched. something that is usually done with window names without any problems - hence finding that the window names were not working correctly)