2019-01-05 20:21:43 +08:00
|
|
|
|
// SettingDlg.cpp : ʵ<><CAB5><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "2015Remote.h"
|
|
|
|
|
|
#include "SettingDlg.h"
|
|
|
|
|
|
#include "afxdialogex.h"
|
2025-03-30 18:03:01 +08:00
|
|
|
|
#include "client/CursorInfo.h"
|
2019-01-05 20:21:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSettingDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CSettingDlg, CDialog)
|
|
|
|
|
|
|
|
|
|
|
|
CSettingDlg::CSettingDlg(CWnd* pParent)
|
|
|
|
|
|
: CDialog(CSettingDlg::IDD, pParent)
|
|
|
|
|
|
, m_nListenPort(0)
|
|
|
|
|
|
, m_nMax_Connect(0)
|
2025-03-13 23:34:33 +08:00
|
|
|
|
, m_sScreenCapture(_T("GDI"))
|
2025-03-30 18:03:01 +08:00
|
|
|
|
, m_sScreenCompress(_T("<EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㷨"))
|
2019-01-05 20:21:43 +08:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CSettingDlg::~CSettingDlg()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CSettingDlg::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
|
{
|
|
|
|
|
|
CDialog::DoDataExchange(pDX);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_PORT, m_nListenPort);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_MAX, m_nMax_Connect);
|
|
|
|
|
|
DDX_Control(pDX, IDC_BUTTON_SETTINGAPPLY, m_ApplyButton);
|
2025-03-13 23:34:33 +08:00
|
|
|
|
DDX_Control(pDX, IDC_COMBO_SCREEN_CAPTURE, m_ComboScreenCapture);
|
|
|
|
|
|
DDX_CBString(pDX, IDC_COMBO_SCREEN_CAPTURE, m_sScreenCapture);
|
|
|
|
|
|
DDV_MaxChars(pDX, m_sScreenCapture, 32);
|
2025-03-30 18:03:01 +08:00
|
|
|
|
DDX_Control(pDX, IDC_COMBO_SCREEN_COMPRESS, m_ComboScreenCompress);
|
|
|
|
|
|
DDX_CBString(pDX, IDC_COMBO_SCREEN_COMPRESS, m_sScreenCompress);
|
2019-01-05 20:21:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CSettingDlg, CDialog)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_BUTTON_SETTINGAPPLY, &CSettingDlg::OnBnClickedButtonSettingapply)
|
|
|
|
|
|
ON_EN_CHANGE(IDC_EDIT_PORT, &CSettingDlg::OnEnChangeEditPort)
|
|
|
|
|
|
ON_EN_CHANGE(IDC_EDIT_MAX, &CSettingDlg::OnEnChangeEditMax)
|
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSettingDlg <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CSettingDlg::OnInitDialog()
|
|
|
|
|
|
{
|
|
|
|
|
|
CDialog::OnInitDialog();
|
|
|
|
|
|
|
2019-01-13 00:04:50 +08:00
|
|
|
|
int nPort = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("settings", "ghost");
|
2019-01-05 20:21:43 +08:00
|
|
|
|
//<2F><>ȡini <20>ļ<EFBFBD><C4BC>еļ<D0B5><C4BC><EFBFBD><EFBFBD>˿<EFBFBD>
|
2019-01-13 00:04:50 +08:00
|
|
|
|
int nMaxConnection = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("settings", "MaxConnection");
|
2019-01-05 20:21:43 +08:00
|
|
|
|
|
2025-03-13 23:34:33 +08:00
|
|
|
|
int DXGI = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("settings", "DXGI");
|
|
|
|
|
|
|
2025-03-30 18:03:01 +08:00
|
|
|
|
CString algo = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetStr("settings", "ScreenCompress", "");
|
|
|
|
|
|
|
2019-01-13 00:04:50 +08:00
|
|
|
|
m_nListenPort = (nPort<=0 || nPort>65535) ? 6543 : nPort;
|
|
|
|
|
|
m_nMax_Connect = nMaxConnection<=0 ? 10000 : nMaxConnection;
|
2019-01-05 20:21:43 +08:00
|
|
|
|
|
2025-03-30 18:03:01 +08:00
|
|
|
|
int n = algo.IsEmpty() ? ALGORITHM_DIFF : atoi(algo.GetString());
|
|
|
|
|
|
switch (n)
|
|
|
|
|
|
{
|
|
|
|
|
|
case ALGORITHM_GRAY:
|
|
|
|
|
|
m_sScreenCompress = "<EFBFBD>Ҷ<EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
|
break;
|
|
|
|
|
|
case ALGORITHM_DIFF:
|
|
|
|
|
|
m_sScreenCompress = "<EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㷨";
|
|
|
|
|
|
break;
|
|
|
|
|
|
case ALGORITHM_H264:
|
|
|
|
|
|
m_sScreenCompress = "H264ѹ<EFBFBD><EFBFBD><EFBFBD>㷨";
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_ComboScreenCompress.InsertString(ALGORITHM_GRAY, "<EFBFBD>Ҷ<EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
|
m_ComboScreenCompress.InsertString(ALGORITHM_DIFF, "<EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㷨");
|
|
|
|
|
|
m_ComboScreenCompress.InsertString(ALGORITHM_H264, "H264ѹ<EFBFBD><EFBFBD><EFBFBD>㷨");
|
|
|
|
|
|
|
2025-03-13 23:34:33 +08:00
|
|
|
|
m_ComboScreenCapture.InsertString(0, "GDI");
|
|
|
|
|
|
m_ComboScreenCapture.InsertString(1, "DXGI");
|
|
|
|
|
|
m_sScreenCapture = DXGI ? "DXGI" : "GDI";
|
|
|
|
|
|
|
2019-01-05 20:21:43 +08:00
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSettingDlg::OnBnClickedButtonSettingapply()
|
|
|
|
|
|
{
|
|
|
|
|
|
UpdateData(TRUE);
|
2019-01-13 00:04:50 +08:00
|
|
|
|
((CMy2015RemoteApp *)AfxGetApp())->m_iniFile.SetInt("settings", "ghost", m_nListenPort);
|
2019-01-05 20:21:43 +08:00
|
|
|
|
//<2F><>ini<6E>ļ<EFBFBD><C4BC><EFBFBD>д<EFBFBD><D0B4>ֵ
|
2019-01-13 00:04:50 +08:00
|
|
|
|
((CMy2015RemoteApp *)AfxGetApp())->m_iniFile.SetInt("settings", "MaxConnection", m_nMax_Connect);
|
2019-01-05 20:21:43 +08:00
|
|
|
|
|
2025-03-13 23:34:33 +08:00
|
|
|
|
int n = m_ComboScreenCapture.GetCurSel();
|
|
|
|
|
|
((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.SetInt("settings", "DXGI", n);
|
|
|
|
|
|
|
2025-03-30 18:03:01 +08:00
|
|
|
|
n = m_ComboScreenCompress.GetCurSel();
|
|
|
|
|
|
((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.SetInt("settings", "ScreenCompress", n);
|
|
|
|
|
|
|
2019-01-05 20:21:43 +08:00
|
|
|
|
m_ApplyButton.EnableWindow(FALSE);
|
|
|
|
|
|
m_ApplyButton.ShowWindow(SW_HIDE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSettingDlg::OnEnChangeEditPort()
|
|
|
|
|
|
{
|
|
|
|
|
|
// TODO: <20><><EFBFBD><EFBFBD><EFBFBD>ÿؼ<C3BF><D8BC><EFBFBD> RICHEDIT <20>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// <20><><EFBFBD>ʹ<EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д CDialog::OnInitDialog()
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CRichEditCtrl().SetEventMask()<29><>
|
|
|
|
|
|
// ͬʱ<CDAC><CAB1> ENM_CHANGE <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㵽<EFBFBD><E3B5BD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>Button<6F><6E><EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD>
|
|
|
|
|
|
m_ApplyButton.ShowWindow(SW_NORMAL);
|
|
|
|
|
|
m_ApplyButton.EnableWindow(TRUE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CSettingDlg::OnEnChangeEditMax()
|
|
|
|
|
|
{
|
|
|
|
|
|
// TODO: <20><><EFBFBD><EFBFBD><EFBFBD>ÿؼ<C3BF><D8BC><EFBFBD> RICHEDIT <20>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// <20><><EFBFBD>ʹ<EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д CDialog::OnInitDialog()
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CRichEditCtrl().SetEventMask()<29><>
|
|
|
|
|
|
// ͬʱ<CDAC><CAB1> ENM_CHANGE <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㵽<EFBFBD><E3B5BD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
HWND hApplyButton = ::GetDlgItem(m_hWnd,IDC_BUTTON_SETTINGAPPLY);
|
|
|
|
|
|
|
|
|
|
|
|
::ShowWindow(hApplyButton,SW_NORMAL);
|
|
|
|
|
|
::EnableWindow(hApplyButton,TRUE);
|
|
|
|
|
|
}
|
2019-08-25 10:06:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSettingDlg::OnOK()
|
|
|
|
|
|
{
|
|
|
|
|
|
OnBnClickedButtonSettingapply();
|
|
|
|
|
|
|
|
|
|
|
|
CDialog::OnOK();
|
|
|
|
|
|
}
|