none
How to capture the window screen when monitor is disconnected (headless)?

    Question

  • Hello All,

    My application is running on virtual machine and take a screen of window at every one minute. It gives the blank screenshot. Using below code for the same.

    HWND    hWndCapture     = ::GetDesktopWindow();
    HDC     hdcScreen       = ::GetDC(hWndCapture);
    HDC     hdcMem          = ::CreateCompatibleDC(hdcScreen);
    
    
    ::BitBlt(    hdcMem,    
    0,    
    0,    
    Width, //width of region of interest    
    Height, //height of region of interest    
    hdcScreen,    
    X, //left staring point for capture    
    Y, //top staring point for capture    
    SRCCOPY);



    Does DirectX can give the correct screenshot while headless mode?

    Does Microsoft provide any kernel level API for headless screen capture?

    Is there any other way to take screen of window?

    Thanks,
    Mahen

    • Edited by GMahen Wednesday, March 29, 2017 12:18 PM Update the query
    Wednesday, March 29, 2017 11:53 AM