What happens if you pass the window number as argument for the function? I.e. hWinSetName = WinSetName(sWinName, 1) if your window has window number 1.
What happens if you pass the window number as argument for the function? I.e. hWinSetName = WinSetName(sWinName, 1) if your window has window number 1.