user-0 提问: 如何用C语言或者C++手动写一个远程监视另一台电脑屏幕的程序啊？

回复:
user: user-1
content: 借个坑，请教个问题： 一个单链表，将链表从最后一个结点 依次间隔插入到从第一个结点之后，比如1->n->2->n-1.......，该怎么操作比较好

user: user-2
content: GetDesktopWindow  后创建一个相同大小的 离屏表面， 隔段时间往自己的表面上 bitblt 就是了， 要达到比较好的性能， 你应该用比较好的办法对图片做编码， 简单点的办法就对 两桢之间的数据做 差分， 对差分的数据做 gz , 把gz 的数据在网络上发送。  写了个简单的 demo 把桌面存成 png ， 大概就这个样子：  #include <windows.h> #include <stdio.h> #include <png.h>  #pragma comment (lib, "libpng-3.lib")  typedef struct { 	BITMAPINFOHEADER    bmiHeader; 	DWORD				R_mask, G_mask, B_mask; } BI_BITFIELDS_BITMAPINFO;  static void user_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { 	fwrite(data, 1, length, (FILE*)png_get_io_ptr(png_ptr)); }  static void user_flush_data(png_structp png_ptr) {	 }  void save_png(const char* path, DWORD* pixels, int width, int height) { 	FILE *fp ; 	 	int  x , y;     png_structp png_ptr  = NULL;     png_infop   info_ptr = NULL; 	png_uint_32 bytes_per_row;     png_byte  **row_pointers = NULL; 	int pix_per_line = width; 	 	fp = fopen( path , "wb" ); 	if(NULL == fp) 		return;  	png_ptr  = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 	if( NULL != png_ptr ) 		info_ptr = png_create_info_struct(png_ptr); 	 	if( NULL == info_ptr ) 	{ 		if( NULL != png_ptr ) 			png_destroy_write_struct(&png_ptr, NULL); 		fclose( fp ); 		return; 	} 	 	if (setjmp(png_jmpbuf(png_ptr))) { 		png_destroy_write_struct(&png_ptr, &info_ptr); 		fclose(fp); 		return;     } 	 	png_set_IHDR(png_ptr, 		info_ptr, 		width  , 		height , 		8, 		PNG_COLOR_TYPE_RGB, 		PNG_INTERLACE_NONE, 		PNG_COMPRESSION_TYPE_DEFAULT, 		PNG_FILTER_TYPE_DEFAULT); 	 	bytes_per_row = width * 3; 	row_pointers = (png_byte  **)png_malloc( png_ptr , height * sizeof(png_byte *) ); 	for( y = 0; y < height; ++y ) 	{ 		BYTE *row = (BYTE*)png_malloc(png_ptr, sizeof(BYTE) * bytes_per_row); 		row_pointers[y] = (png_byte *)row; 		for( x = 0; x < width; ++x ) 		{ 			DWORD	 pix = pixels[ y * pix_per_line + x ]; 			*row++ = (BYTE)(pix >> 16); 			*row++ = (BYTE)(pix >> 8); 			*row++ = (BYTE)(pix); 		} 	} 	 	png_set_write_fn(png_ptr,(png_voidp)fp,user_write_data,user_flush_data);     png_set_rows(png_ptr, info_ptr, row_pointers);     png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); 	     for (y = 0; y < height; y++) { 		png_free(png_ptr, row_pointers[y]);     }     png_free(png_ptr, row_pointers); 	     png_destroy_write_struct(&png_ptr, &info_ptr);     fclose(fp);     }  int main() { 	int i; 	HDC   hDCOffScreen = NULL; 	HBITMAP hBmpOffScr = NULL, hOldBmp = NULL; 	DWORD* pixels = NULL; 	DWORD width, height; 	char  path[300];  	BI_BITFIELDS_BITMAPINFO	bmi; 	BITMAPINFOHEADER *lpInfoh; 	RECT rct; 	HWND hWnd = GetDesktopWindow(); 	HDC  hDC  = GetDC(hWnd);  	GetClientRect(hWnd, &rct); 	width = rct.right - rct.left; 	height = rct.bottom - rct.top; 	lpInfoh = &bmi.bmiHeader;	 	lpInfoh->biSize = sizeof(BITMAPINFOHEADER); 	lpInfoh->biWidth = width; 	lpInfoh->biHeight = height * -1; 	lpInfoh->biPlanes = 1; 	lpInfoh->biBitCount = 8 * 4;		/*  */ 	lpInfoh->biCompression = BI_BITFIELDS;	 	lpInfoh->biSizeImage = 0; 	lpInfoh->biXPelsPerMeter = 0; 	lpInfoh->biYPelsPerMeter = 0; 	lpInfoh->biClrUsed = 0; 	lpInfoh->biClrImportant = 0;	 	bmi.R_mask = 0xFF0000;  	bmi.G_mask = 0x00FF00; 	bmi.B_mask = 0x0000FF;  	hBmpOffScr = CreateDIBSection(hDC, (BITMAPINFO*)&bmi, DIB_RGB_COLORS, (VOID**)&pixels, NULL, 0); 	hDCOffScreen = CreateCompatibleDC(hDC); 	hOldBmp = (HBITMAP)SelectObject(hDCOffScreen, hBmpOffScr);  	for(i = 0; i < 10; ++i) 	{ 		DWORD dtTick = GetTickCount(), dtTick2; 		BitBlt(hDCOffScreen, 0, 0, width, height, hDC, 0, 0, SRCCOPY); 		dtTick2 = GetTickCount(); 		sprintf(path, "screen%d.png", i); 		save_png(path, pixels, width, height); 		printf("Time used : %d %d\n", dtTick2 - dtTick, GetTickCount() - dtTick); 		Sleep(1000); 	}  	/* Release XXXX */  return 0; }

user: user-3
content: 找一个开源远程监视项目参考之。

user: user-4
content: 你先打好基础，会用网络编程收发数据就行，目标主机不断把桌面图片发送过来

user: user-0
content: 人工顶一下，来人啊