添加控制列表右键菜单响应,删除指定条目通知log打印消息

This commit is contained in:
changcheng 2020-05-14 17:32:36 +08:00
parent 3e73beae9f
commit 848bf9f560
9 changed files with 116 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -72,6 +72,16 @@ BEGIN_MESSAGE_MAP(CCcRemoteDlg, CDialogEx)
ON_WM_QUERYDRAGICON()
ON_WM_SIZE()
ON_NOTIFY(NM_RCLICK, IDC_ONLINE, &CCcRemoteDlg::OnNMRClickOnline)
ON_COMMAND(ID_ONLINE_AUDIO, &CCcRemoteDlg::OnOnlineAudio)
ON_COMMAND(ID_ONLINE_CMD, &CCcRemoteDlg::OnOnlineCmd)
ON_COMMAND(ID_ONLINE_DESKTOP, &CCcRemoteDlg::OnOnlineDesktop)
ON_COMMAND(ID_ONLINE_FILE, &CCcRemoteDlg::OnOnlineFile)
ON_COMMAND(ID_ONLINE_PROCESS, &CCcRemoteDlg::OnOnlineProcess)
ON_COMMAND(ID_ONLINE_REGIST, &CCcRemoteDlg::OnOnlineRegist)
ON_COMMAND(ID_ONLINE_SERVER, &CCcRemoteDlg::OnOnlineServer)
ON_COMMAND(ID_ONLINE_VIDEO, &CCcRemoteDlg::OnOnlineVideo)
ON_COMMAND(ID_ONLINE_WINDOW, &CCcRemoteDlg::OnOnlineWindow)
ON_COMMAND(ID_ONLINE_DELETE, &CCcRemoteDlg::OnOnlineDelete)
END_MESSAGE_MAP()
@ -267,7 +277,10 @@ void CCcRemoteDlg::ShowMessage(bool bIsOK, CString strMsg)
void CCcRemoteDlg::Test()
{
AddList("192.168.0.1", "本机局域网", "Lang", "Windows7", "2.2GHZ", "", "123232");
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");
ShowMessage(true, "软件初始化成功...");
}
@ -292,3 +305,71 @@ void CCcRemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this); //在指定位置显示菜单
*pResult = 0;
}
void CCcRemoteDlg::OnOnlineAudio()
{
// TODO: 在此添加命令处理程序代码
MessageBox("声音");
}
void CCcRemoteDlg::OnOnlineCmd()
{
// TODO: 在此添加命令处理程序代码
MessageBox("CMD");
}
void CCcRemoteDlg::OnOnlineDesktop()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineFile()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineProcess()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineRegist()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineServer()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineVideo()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineWindow()
{
// TODO: 在此添加命令处理程序代码
}
void CCcRemoteDlg::OnOnlineDelete()
{
// TODO: 在此添加命令处理程序代码
CString strIP;//选择断开的IP
int iSelect = m_CList_Online.GetSelectionMark();//获得选中的行
strIP = m_CList_Online.GetItemText(iSelect, ONLINELIST_IP);//获取断开的IP字符串
m_CList_Online.DeleteItem(iSelect);//删除该列表项
strIP += " 由主机主动断开连接";
ShowMessage(true, strIP);//显示日志
}

View File

@ -70,4 +70,14 @@ private:
void Test();
public:
afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnOnlineAudio();
afx_msg void OnOnlineCmd();
afx_msg void OnOnlineDesktop();
afx_msg void OnOnlineFile();
afx_msg void OnOnlineProcess();
afx_msg void OnOnlineRegist();
afx_msg void OnOnlineServer();
afx_msg void OnOnlineVideo();
afx_msg void OnOnlineWindow();
afx_msg void OnOnlineDelete();
};

View File

@ -0,0 +1,19 @@
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\ccremotedlg.obj
g:\ccremote\ccremote\ccremote\ccremote\debug\ccremote.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

View File

@ -1,7 +1,7 @@
 pch.cpp
CcRemote.cpp
CcRemoteDlg.cpp
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(195): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(212): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(205): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
g:\ccremote\ccremote\ccremote\ccremote\ccremotedlg.cpp(222): warning C4244: “初始化”: 从“double”转换到“int”可能丢失数据
正在生成代码...
CcRemote.vcxproj -> G:\CcRemote\CcRemote\CcRemote\Debug\CcRemote.exe

Binary file not shown.

View File

@ -30,13 +30,15 @@
#define ID_ONLINE_AUDIO 32786
#define ID_ONLINE_REGIST 32787
#define ID_ONLINE_CMD 32788
#define ID_ONLINE_32789 32789
#define ID_ONLINE_DELETE 32790
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 32789
#define _APS_NEXT_COMMAND_VALUE 32791
#define _APS_NEXT_CONTROL_VALUE 1002
#define _APS_NEXT_SYMED_VALUE 101
#endif

Binary file not shown.