fix for #1671 saving window settings

- we should not save settings from hidden windows.
- also should we respect cancellation

Closes #1671 SaveWindowPosition saves to position 0,0 if window not shown