Пример #1
0
/*****************************************************************
Screenshot full window

Return Value:
0 - success
other - fail
******************************************************************/
int ScreenshotFullWindow(char * fileName)
{
	int iRet = -1;
	if(fileName == NULL) return iRet;
	if(CaptureDesktop(fileName)) iRet = 0;
	return iRet;
}
BOOL CALLBACK MonitorEnumProc(
	HMONITOR hMonitor,  // handle to display monitor
	HDC hdcMonitor,        // handle to monitor DC
	LPRECT lprcMonitor,   // monitor intersection rectangle
	LPARAM dwData         // data
	)
{
	auto hdcPool = reinterpret_cast<std::vector<std::shared_ptr<RemoteDesktop::Image>>*>(dwData);
	auto desktopGuard(RAIIHDC(hdcMonitor));
	RECT rect = *lprcMonitor;
	hdcPool->push_back(CaptureDesktop(desktopGuard, lprcMonitor->left, lprcMonitor->top));	
	return true;
}