I'm having an issue I want to handle before it becomes too much of a problem. When I start my app, I restore the windows which were open when I last quit to the same locations and general state they were in at the time. I have written the code necessary to confirm that the window is fully on-screen (in case of montitor switches etc. from when shutdown, I hate when other apps restore windows off screen and are very difficult to find and get back on screen) if needed the window gets shifted, generally as little as possible to be on-screen.
My problem is on a mac with spaces (virtual desktops) enabled where each monitor has its own space. I can't seem to find out anything about 'which space' a window is located within. I expect the same problem on Windows will also exist in similar configurations. Any ideas as to how to determine the 'space' the window is within?