2

我运行测试程序 windows8 或 7 64/32bit

但是运行虚拟桌面时我无法捕获屏幕

这是我的代码

hwnd h1 = createwindows(....) or dialog.. //if this line remove capture code works fine

hDesktopCurrent = NULL;
hOriginalInput = NULL;
hDesktopCurrent = GetThreadDesktop(GetCurrentThreadId());
hOriginalInput = OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP);

hDeskVirtual= NULL;

attr.nLength = sizeof(attr);
attr.lpSecurityDescriptor = NULL;
attr.bInheritHandle = true;

hDeskVirtual= CreateDesktopEx(
    "my_new_desktop_1",
    NULL,
    NULL,
    0,
    GENERIC_ALL,
    &attr,
    0,
    NULL);

SwitchDesktop(hDeskVirtual);
SetThreadDesktop(hDeskVirtual);

//capture here

SwitchDesktop(originaldesktop);
SetThreadDesktop(originaldesktop);

ps:当我在switchdesktop(例如:createwindows,creatdialog ...)之前创建任何窗口hwnd时,它可以完美地捕获..

但我创建了任何窗口框架或对话框,它只捕获 BlackScreen 不起作用

请..帮帮我!

4

0 回答 0