Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Use of the Windows desktop by Modern UI apps #36

Open
langweg opened this issue May 11, 2018 · 3 comments
Open

Use of the Windows desktop by Modern UI apps #36

langweg opened this issue May 11, 2018 · 3 comments
Labels

Comments

@langweg
Copy link
Contributor

langweg commented May 11, 2018

This is more of a side project.

Modern UI apps draw on a surface that seems to be drawn on the regular default desktop. Can the visible content of a Modern UI app be retrieved from the desktop surface? It has been demonstrated that access to user input (e.g. a keylogger) works well for applications that are executed in the same session. An open question is how easy it is to find out what a Modern UI app draws on the screen.

@langweg langweg added the ToDo label May 11, 2018
@DonatJR
Copy link
Contributor

DonatJR commented Jul 25, 2018

just a small and in no way exhaustive test: capturing the contents of the windows weather app (https://www.microsoft.com/en-us/p/msn-weather/9wzdncrfj3q2) works without any problems using the built in capture (print key) as well as with a little C# code (Windows 10, non admin user):

Rectangle bounds = Screen.GetBounds(Point.Empty);
using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
    using (Graphics g = Graphics.FromImage(bitmap))
    {
        g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
    }
    bitmap.Save("test.jpg", ImageFormat.Jpeg);
}

@langweg
Copy link
Contributor Author

langweg commented Aug 23, 2018

Can the C# code be used from a Modern UI app?

@DonatJR
Copy link
Contributor

DonatJR commented Aug 23, 2018

I never worked with UWP apps before so I just tested it for the first time. It could be that I am missing something, but it seems the necessary namespaces for the code are not available when developing UWP apps. However, there is an official (different) solution for capturing screen contents from Microsoft: https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants