I'm building a software which can capture the screen efficiently, I tried DC(BitBlt), D3D(GetFrontBuffer), but each of them would cost me more than 40ms to capture a full screen(1680*1050, it might be more at a higher resolution I guess). So I wanted to use Mirror Driver tech which was a recommanded way to capture screen by Microsoft on Windows 7.
I've installed the DFMirage for TightVNC version 2.0.105.0, cause I cannot install the driver files in dfmirage-sdk-1.2.74.0.zip(I thought the ExtEscape function would work correctly with this version of drivers, but I've tried all the methods I ever known to install it, but failed).
There was even an .cpp file of a Driver Installer. I tried this too, wouldn't work.
And the iss file, I couldn't build a setup.exe, there was errors occured. And might be more.
params := Format4('-i "%s" "%s" "%s" "%s"', HW_ID, HW_DESCR, workingDir, ExpandConstant('{tmp}\' + DFMIRAGE_INF));
the "Format4" couldn't be recognized.
I wrote a small MFC application to test the ExtEscape function introduced in the SDK.doc from the dfmirage-sdk-1.2.74.0.zip, but it returned 0, meant failed.
HDC m_hdc = NULL;
m_hdc = CreateDC(_T("DISPLAY"), 0, 0, 0);
if (m_hdc == NULL)
{
DWORD dwError = GetLastError();
TRACE(_T("CreateDC failed, Error code = %d\r\n"), dwError);
return;
}
GETCHANGESBUF changeBuf = { 0 };
INT nOutSize = sizeof(GETCHANGESBUF);
INT nRtn = ExtEscape(m_hdc, dmf_esc_usm_pipe_map, 0, NULL, nOutSize, (LPSTR)(&changeBuf));
if (nRtn <= 0)
{
CString str;
str.Format(_T("ExtEscape failed, returns %d\r\n"), nRtn);
MessageBox(str);
}
else
{
CString str;
str.Format(_T("OK, 0x%08X, 0x%08X"), changeBuf.buffer, changeBuf.Userbuffer);
MessageBox(str);
}
DeleteDC(m_hdc);
return;
I'm such grateful if someone helps me. :-)