proper end session with setwindowlong