会话0捕获屏幕 [英] Session 0 capture screen

查看:252
本文介绍了会话0捕获屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试 https://stackoverflow.com/a/30138664/533237 并能够捕获屏幕。

但是我想从会话0或另一个用户中运行的应用程序捕获屏幕。在捕获并切换到另一个用户之前引入了10秒钟的睡眠。
还尝试了PsExec.exe -h -s E:\sc.exe。都抛出错误

But I want to capture screen from an application running in session 0 or another user.Introduced a 10 sec sleep before capturing and switched to another user. Also tried PsExec.exe -h -s E:\sc.exe. Both throws error

C:\Users\unity\Documents\Visual Studio 2015\Projects\ConsoleApplication2\Debug>sc.exe
FAILURE 0x8876086C (-2005530516)
    line: 60 file: 'c:\users\unity\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp'
    expr: 'd3d->GetAdapterDisplayMode(adapter, &mode)'

C:\Users\unity\Documents\Visual Studio 2015\Projects\ConsoleApplication2\Debug>PsExec.exe -h -s  E:\sc.exe -w E:\
PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com


FAILURE 0x8876086C (-2005530516)
    line: 60 file: 'c:\users\unity\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp'
    expr: 'd3d->GetAdapterDisplayMode(adapter, &mode)'

注释掉GetAdapterDispla yMode和硬编码的高度和宽度,但CreateDevice失败

Commented out GetAdapterDisplayMode and hardcoded height and width but CreateDevice failed

FAILURE 0x8876086A (-2005530518)
    line: 76 file: 'c:\users\unity\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp'
    expr: 'd3d->CreateDevice(adapter, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &parameters, &device)'

编辑:
想法是单个应用程序在后台运行,并捕获显示的所有内容,无论用户是否登录(即使没有人登录)(锁定/登录屏幕)

Edited: Idea is to have a single app running in background and capture anything getting displayed irrespective of the user logged in or even if no one is logged in (lock/login screen)

推荐答案

这个问题有两个层次。

在一个层次上,虽然很多GDI都可以工作,但会话0并未链接到功能显示

On one level, while a lot of GDI will work, session 0 is not linked to a functional display device, certainly not one that is capable of D3D.

在另一个层面上,虽然引入了DWM之类的东西,但Windows API始终提供根本不存在看不见的屏幕像素的显示模型。整个Windows显示模型都是围绕使窗口进行协作绘制到共享的显示表面而构建的,而未发现的窗口的任何部分都将由桌面合成系统按需重新绘制。

On another level, while things like the DWM have been introduced, the Windows API has always presented a display model where invisible screen pixels simply don't exist. The entire windows display model is built around getting windows to co-operative paint to a shared display surface, and any parts of a window that are uncovered are repainted on demand by the desktop composition system.

这意味着,从根本上讲,您无法截屏来自会话0的任何内容,因为要这样做,必须将会话0连接到活动显示设备上。

This means, in a very fundamental way, you cannot screen capture anything from session 0 as, in order to do so, session 0 would have to be attached to the active display device.

这篇关于会话0捕获屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆