The code which realizes functionality " Control of selected clients "
control group in Control Panel has been added.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@436 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/winvnc/ControlPanel.cxx b/winvnc/ControlPanel.cxx
index fb379d6..1f69306 100644
--- a/winvnc/ControlPanel.cxx
+++ b/winvnc/ControlPanel.cxx
@@ -37,18 +37,9 @@
case IDC_ADD_CLIENT:
SendMessage(m_hSTIcon, WM_COMMAND, ID_CONNECT, 0);
return false;
- case IDC_KILL_SEL_CLIENT:
- {
-
- return false;
- }
case IDC_KILL_ALL:
{
- COPYDATASTRUCT copyData;
- copyData.dwData = 2;
- copyData.lpData = 0;
- copyData.cbData = 0;
- SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)©Data);
+ SendCommand(2, -1);
return false;
}
case IDC_DISABLE_CLIENTS:
@@ -56,6 +47,27 @@
return false;
}
+ case IDC_KILL_SEL_CLIENT:
+ {
+ SendCommand(3, 3);
+ return false;
+ }
+ case IDC_VIEW_ONLY:
+ {
+ SendCommand(3, 1);
+ return false;
+ }
+ case IDC_FULL_CONTROL:
+ {
+ SendCommand(3, 0);
+ return false;
+ }
+ case IDC_STOP_UPDATE:
+ {
+ stop_updating = true;
+ EndDialog(handle, 0);
+ return false;
+ }
}
return false;
@@ -92,6 +104,13 @@
handle = hwnd;
initDialog();
return TRUE;
+ case WM_DESTROY:
+ if (stop_updating) {
+ stop_updating = false;
+ SendCommand(3, 2);
+ }
+ initDialog();
+ return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
@@ -117,6 +136,23 @@
}
}
+void ControlPanel::SendCommand(DWORD command, int data)
+{
+ COPYDATASTRUCT copyData;
+ copyData.dwData = command;
+ copyData.lpData = 0;
+ if (data != -1) {
+ getSelConnInfo();
+ ListConnStatus.Copy(&ListSelConn);
+ for (ListConnStatus.iBegin(); !ListConnStatus.iEnd(); ListConnStatus.iNext())
+ ListConnStatus.iSetStatus(data);
+ copyData.cbData = (DWORD)&ListConnStatus;
+ } else {
+ copyData.cbData = 0;
+ }
+ SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)©Data);
+}
+
ControlPanel::~ControlPanel()
{