增加了一些注释和简单的代码,关于界面

This commit is contained in:
ChangCheng 2020-06-05 20:15:06 +08:00
parent 41c189a5a7
commit eed525d3f5
14 changed files with 143 additions and 63 deletions

Binary file not shown.

Binary file not shown.

View File

@ -261,6 +261,7 @@
<None Include="res\dot.cur" />
</ItemGroup>
<ItemGroup>
<Image Include="res\background_picture.bmp" />
<Image Include="res\CcRemote.ico" />
<Image Include="res\cmdshell.ico" />
<Image Include="res\system.ico" />

View File

@ -149,5 +149,8 @@
<Image Include="res\system.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\background_picture.bmp">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project>

View File

@ -107,6 +107,8 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
ON_COMMAND(IDM_MAIN_BUILD, &CCcRemoteDlg::OnMainBuild)
ON_COMMAND(IDM_MAIN_ABOUT, &CCcRemoteDlg::OnMainAbout)
ON_WM_CLOSE()
ON_WM_ERASEBKGND()
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()
@ -373,6 +375,16 @@ int CCcRemoteDlg::InitMyMenu()
int CCcRemoteDlg::InitList()
{
//m_CList_Online.SetTextBkColor(CLR_NONE);
//m_CList_Online.SetBkColor(CLR_NONE);
//m_CList_Online.SetTextColor(RGB(255, 0, 0));
//TCHAR szBuffer[_MAX_PATH];
//VERIFY(::GetModuleFileName(AfxGetInstanceHandle(), szBuffer, _MAX_PATH));
////CString sPath = (CString)szBuffer; sPath = sPath.Left(sPath.ReverseFind('\\') + 1);
//CString sPath = "F:\myapp\\CcRemote\\CcRemote\\CcRemote\\background_picture.bmp";
//m_CList_Online.SetBkImage(sPath.GetBuffer(sPath.GetLength()), TRUE); // 定义CListCtrl m_controllist1;
//sPath.ReleaseBuffer();
//设置list可选中
m_CList_Online.SetExtendedStyle(LVS_EX_FULLROWSELECT);
m_CList_Message.SetExtendedStyle(LVS_EX_FULLROWSELECT);
@ -612,6 +624,7 @@ void CCcRemoteDlg::InitStatusBar()
//初始化工具条按钮控件
void CCcRemoteDlg::InitToolBar()
{
//创建工具条
if (!m_ToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
@ -650,6 +663,7 @@ void CCcRemoteDlg::InitToolBar()
m_ToolBar.SetButtonText(10, "参数设置");
m_ToolBar.SetButtonText(11, "生成服务端");
m_ToolBar.SetButtonText(12, "帮助");
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
}
@ -1014,3 +1028,58 @@ LRESULT CCcRemoteDlg::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam)
pContext->m_Dialog[1] = (int)dlg;
return 0;
}
//绘制背景图片
BOOL CCcRemoteDlg::OnEraseBkgnd(CDC* pDC)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CDC MemDC; MemDC.CreateCompatibleDC(pDC);
CBitmap Cbp;
Cbp.LoadBitmap(IDB_BACKGROUND_CCREMOTE);
MemDC.SelectObject(&Cbp);
BITMAP Bp;
Cbp.GetBitmap(&Bp);
CRect rect;
GetClientRect(&rect);
pDC->StretchBlt(0, 0, rect.Width(), rect.Height(), &MemDC, 0, 0, Bp.bmWidth, Bp.bmHeight, SRCCOPY);
MemDC.DeleteDC();
return TRUE;
//return CDialogEx::OnEraseBkgnd(pDC);
}
HBRUSH CCcRemoteDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: 在此更改 DC 的任何特性
//switch (pWnd->GetDlgCtrlID()) {
////case IDC_STATIC_NAME:
////case IDC_STATIC_ID:
////case IDC_STATIC_PW:
//// pDC->SetBkMode(TRANSPARENT);
//// pDC->SetTextColor(RGB(0, 255, 0));
//// hbr = (HBRUSH)GetStockObject(NULL_BRUSH);//空画刷,不加此句会有阴影
//// break;
//case IDR_TOOLBAR_MAIN:
// CWnd* pd;
// CRect rc;
// if (pWnd->GetDlgCtrlID() == IDR_TOOLBAR_MAIN)
// pd = (CWnd*)GetDlgItem(IDR_TOOLBAR_MAIN);
// pd->GetClientRect(&rc);
// ScreenToClient(&rc);
// pDC->SetBkMode(TRANSPARENT);
// pDC->SetTextColor(RGB(255, 0, 0));
// CBitmap bmp;
// bmp.LoadBitmap(IDB_BACKGROUND_CCREMOTE);
// CBrush brush(&bmp);
// CBrush* pOldBrush = (CBrush*)pDC->SelectObject(&brush);
// pDC->FillRect(&rc, &brush);
// hbr = (HBRUSH)brush;
// break;
//}
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
return hbr;
}

View File

@ -121,4 +121,7 @@ public:
afx_msg void OnClose();
private:
void SendSelectCommand(PBYTE pData, UINT nSize);
public:
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
};

View File

@ -1,30 +1,30 @@
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\seu_qqwry.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\inifile.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cpuusage.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\csystemdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cshelldlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\csettingdlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\cscreenspydlg.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\bin\ccremote.ilk
g:\ccremote\ccremote\bin\ccremote.exe
g:\ccremote\ccremote\bin\ccremote.pdb
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.res
g:\ccremote\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
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
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.pch
f:\myapp\ccremote\ccremote\ccremote\debug\vc141.pdb
f:\myapp\ccremote\ccremote\ccremote\debug\vc141.idb
f:\myapp\ccremote\ccremote\ccremote\debug\pch.obj
f:\myapp\ccremote\ccremote\ccremote\debug\truecolortoolbar.obj
f:\myapp\ccremote\ccremote\ccremote\debug\seu_qqwry.obj
f:\myapp\ccremote\ccremote\ccremote\debug\inifile.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cpuusage.obj
f:\myapp\ccremote\ccremote\ccremote\debug\csystemdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cshelldlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\csettingdlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\cscreenspydlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\ccremotedlg.obj
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.obj
f:\myapp\ccremote\ccremote\ccremote\debug\iocpserver.obj
f:\myapp\ccremote\ccremote\ccremote\debug\buffer.obj
f:\myapp\ccremote\bin\ccremote.ilk
f:\myapp\ccremote\bin\ccremote.exe
f:\myapp\ccremote\bin\ccremote.pdb
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.res
f:\myapp\ccremote\ccremote\ccremote\..\..\bin\ccremote.exe
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.command.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.read.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\cl.write.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.command.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.read.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\link.write.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.command.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.read.1.tlog
f:\myapp\ccremote\ccremote\ccremote\debug\ccremote.tlog\rc.write.1.tlog

View File

@ -1,45 +1,45 @@
G:\VS2017\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\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(162): 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(167): 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(308): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(325): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(798): warning C4018: “<=”: 有符号/无符号不匹配
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(880): 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”的声明
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(164): 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(169): 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(310): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(327): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(812): warning C4018: “<=”: 有符号/无符号不匹配
f:\myapp\ccremote\ccremote\ccremote\ccremotedlg.cpp(894): 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”的声明
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”的声明
g:\ccremote\ccremote\ccremote\ccremote\cscreenspydlg.cpp(607): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
g:\ccremote\ccremote\ccremote\ccremote\cscreenspydlg.cpp(621): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
f:\myapp\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
d:\windows kits\10\include\10.0.17763.0\um\winsock2.h(1849): note: 参见“inet_ntoa”的声明
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(607): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
f:\myapp\ccremote\ccremote\ccremote\cscreenspydlg.cpp(621): warning C4554: “<<”: 检查运算符优先级是否存在的可能的错误;使用括号阐明优先级
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: “<”: 有符号/无符号不匹配
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: “<”: 有符号/无符号不匹配
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”的声明
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”的声明
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”的声明
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”的声明
SEU_QQwry.cpp
TrueColorToolBar.cpp
正在生成代码...
Buffer.cpp
IOCPServer.cpp
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(725): 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(774): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\include\iocpserver.cpp(920): warning C4018: “>=”: 有符号/无符号不匹配
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(725): 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(774): warning C4244: “初始化”: 从“double”转换到“unsigned long”可能丢失数据
f:\myapp\ccremote\ccremote\ccremote\include\iocpserver.cpp(920): warning C4018: “>=”: 有符号/无符号不匹配
正在生成代码...
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe
CcRemote.vcxproj -> F:\myapp\CcRemote\CcRemote\CcRemote\..\..\bin\CcRemote.exe

Binary file not shown.

View File

@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|Win32|G:\CcRemote\CcRemote\CcRemote\|
Debug|Win32|F:\myapp\CcRemote\CcRemote\|

View File

@ -1291,6 +1291,8 @@ void CIOCPServer::ResetConnection(ClientContext* pContext)
}
}
//清理所有
void CIOCPServer::DisconnectAll()
{
m_bDisconnectAll = true;

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 MiB

View File

@ -30,6 +30,8 @@
#define IDD_SCREENSPY 149
#define IDI_DOT 153
#define IDC_DOT 153
#define IDB_BACKGROUND_ 154
#define IDB_BACKGROUND_CCREMOTE 154
#define IDC_ONLINE 1000
#define IDC_LIST2 1001
#define IDC_MESSAGE 1001
@ -112,7 +114,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 154
#define _APS_NEXT_RESOURCE_VALUE 155
#define _APS_NEXT_COMMAND_VALUE 32839
#define _APS_NEXT_CONTROL_VALUE 1006
#define _APS_NEXT_SYMED_VALUE 101

Binary file not shown.