Returning a value from a window; waiting for window close

For anyone still looking for a solution, check out my post in this thread.