2

テスト プログラム windows8 または 7 64/32 ビットを実行します

しかし、仮想デスクトップを実行しているときに画面をキャプチャできません

ここに私のコードがあります

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...) の前に任意のウィンドウを作成すると、完全にキャプチャされます..

Windowsフレームまたはダイアログを作成しましたが、BlackScreenをキャプチャしただけでは機能しませんでした

助けてください!

4

0 に答える 0