How to get the Window Position of the Unity Application

Hi, I use ingame Screenshots as splash screens. It works excellent in fullscreen mode but I cant get it to work in windowed mode because I don’t know the position of my application window. Is there any way to get the screen coordinates of the application?

using this for capturing:

 // Read screen contents into the texture
        SplashScreen.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
        SplashScreen.Apply();

I need something like Application.getScreenRect() to get the upper left cornor of my application on screen.

Thank you for any help.

And why would you need the rect? ReadPixels reads the content within the game window, not behind the game window so the position of the rect on the screen should be of no importance as the coordinates are always 0,0 up to screen width / height
Also you can’t draw outside the unity window with unity functions

but perhaps I missunderstand why you would need it?

Thanks for the hint. My falt was reusing the texture without generating it new with the new dimensions after changing from full screen to windowed mode. So the size didn’t change…

I require the window’s coordinates in screen space, because I am using a gaze tracker, which returns values in screen space.

So if I may reopen this thread…

I found a couple of links giving platform specific (Windows only) techniques:

http://stackoverflow.com/questions/27631166/access-to-unity3d-created-application-windows-code

Also, an unanswered four year old question here: http://answers.unity3d.com/questions/168297/absolute-window-position-of-unity-application.html

Is there any way to do this without using plug-ins?

π

PS if I check ‘maximise on play’, it still isn’t quite fullscreen because there is a header and footer. So the problem remains of determining coordinates of the actual drawing surface.