登录屏幕上的Windows桌面屏幕截图

时间:2012-02-01 15:25:35

标签: login screen screenshot

是否可以在登录屏幕上拍摄Windows桌面的屏幕截图?

我在C#中构建一个捕获屏幕的Windows服务但是当我注销时,我得到了 消息“句柄无效。”

的异常

我使用了这段代码

Bitmap bitmap = new Bitmap(SelectionRectangle.Width, SelectionRectangle.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
   g.CopyFromScreen(SourcePoint, DestinationPoint, SelectionRectangle.Size);
}

使用Windows API可以解决问题吗?

我正在尝试实现像Ultra VNC这样的功能。

1 个答案:

答案 0 :(得分:0)

我认为问题可能是你在错误的WindowStation上。看看这些文章;

Why does print screen in a Windows Service return a black image?

Screen capture from windows service

您可能需要枚举win-station并找到登录桌面并使用它。

相关问题