// Set.cpp : implementation file
//

#include "stdafx.h"
#include "ylgl.h"
#include "Set.h"
#include "UploadDes.h"
//***********************//
#include "Login.h"
#include "Login3.h"
#include "StaffAchievementSet.h"
//***********************//
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Set dialog IDC_CHECK15 IDC_CHECK16
Set::Set(CWnd* pParent /*=NULL*/)
: CDialog(Set::IDD, pParent)
{
	//{{AFX_DATA_INIT(Set)
	setcheck1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(58));
	setcheck2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(59));
	setcheck3 = atoi(g_cominfoarray.ElementAt(0).ElementAt(60));
	setcheck4 = atoi(g_cominfoarray.ElementAt(0).ElementAt(61));
	setcheck5 = atoi(g_cominfoarray.ElementAt(0).ElementAt(62));
	m_check20 = FALSE;
	m_printer1 = g_cominfoarray.ElementAt(0).ElementAt(63);
	m_printer2 = g_cominfoarray.ElementAt(0).ElementAt(64);
	m_printer3 = g_cominfoarray.ElementAt(0).ElementAt(65);
	m_uploadcheck1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(67));
	m_uploadcheck2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(68));
	m_uploadcheck3 = atoi(g_cominfoarray.ElementAt(0).ElementAt(69));
	m_uploadcheck4 = atoi(g_cominfoarray.ElementAt(0).ElementAt(70));
	setcheck10 =atoi(g_cominfoarray.ElementAt(0).ElementAt(76));
	setcheck11 =atoi(g_cominfoarray.ElementAt(0).ElementAt(85));
	setcheck12 = atoi(g_cominfoarray.ElementAt(0).ElementAt(86));
	setcheck13 = atoi(g_cominfoarray.ElementAt(0).ElementAt(95));
	m_time1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(96));
	m_time2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(97));
	setcheck14 = atoi(g_cominfoarray.ElementAt(0).ElementAt(99));
	setcheck15 = atoi(g_cominfoarray.ElementAt(0).ElementAt(100));
	setcheck6 = atoi(g_cominfoarray.ElementAt(0).ElementAt(109));
	setcheck17 = atoi(g_cominfoarray.ElementAt(0).ElementAt(113));
	setcheck18 = atoi(g_cominfoarray.ElementAt(0).ElementAt(114));
	setcheck19 = atoi(g_cominfoarray.ElementAt(0).ElementAt(115));
	setcheck20 = atoi(g_cominfoarray.ElementAt(0).ElementAt(117));
	setcheck21 = atoi(g_cominfoarray.ElementAt(0).ElementAt(121));
	setcheck22 = atoi(g_cominfoarray.ElementAt(0).ElementAt(130));
	setcheck23 = atoi(g_cominfoarray.ElementAt(0).ElementAt(131));
	setcheck24 = atoi(g_cominfoarray.ElementAt(0).ElementAt(133));
	outtime =  g_cominfoarray.ElementAt(0).ElementAt(134);
	m_time3 = g_cominfoarray.ElementAt(0).ElementAt(98);
	reverse1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(136));
	reverse2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(137));
	reverse3 = atoi(g_cominfoarray.ElementAt(0).ElementAt(138));
	reverse4 = atoi(g_cominfoarray.ElementAt(0).ElementAt(139));
	reverse5 = atoi(g_cominfoarray.ElementAt(0).ElementAt(140));
	m_RemoteChoosePhoto = FALSE;
}

void Set::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Set)
	DDX_Control(pDX, IDC_EDIT5, m_numedit2);
	DDX_Control(pDX, IDC_EDIT4, m_numedit1);
	DDX_Control(pDX, IDC_COMBO4, m_combo4);
	DDX_Control(pDX, IDC_COMBO3, m_combo3);
	DDX_Control(pDX, IDC_COMBO2, m_combo2);
	DDX_Control(pDX, IDC_COMBO1, m_combo1);
	DDX_Check(pDX, IDC_CHECK1, setcheck1);
	DDX_Check(pDX, IDC_CHECK2, setcheck2);
	DDX_Check(pDX, IDC_CHECK3, setcheck3);
	DDX_Check(pDX, IDC_CHECK4, setcheck4);
	DDX_Check(pDX, IDC_CHECK5, setcheck5);
	DDX_Check(pDX, IDC_CHECK20, m_check20);
	DDX_Text(pDX, IDC_EDIT1, m_printer1);
	DDX_Text(pDX, IDC_EDIT2, m_printer2);
	DDX_Text(pDX, IDC_EDIT3, m_printer3);
	DDX_Check(pDX, IDC_CHECK6, m_uploadcheck1);
	DDX_Check(pDX, IDC_CHECK7, m_uploadcheck2);
	DDX_Check(pDX, IDC_CHECK8, m_uploadcheck3);
	DDX_Check(pDX, IDC_CHECK9, m_uploadcheck4);
	DDX_Check(pDX, IDC_CHECK10, setcheck10);
	DDX_Check(pDX, IDC_CHECK11, setcheck11);
	DDX_Check(pDX, IDC_CHECK12, setcheck12);
	DDX_Check(pDX, IDC_CHECK13, setcheck13);
	DDX_Text(pDX, IDC_EDIT4, m_time1);
	DDX_Text(pDX, IDC_EDIT5, m_time2);
	DDX_Check(pDX, IDC_CHECK14, setcheck14);
	DDX_Check(pDX, IDC_CHECK15, setcheck15);
	DDX_Check(pDX, IDC_CHECK16, setcheck6);
	DDX_Check(pDX, IDC_CHECK17, setcheck17);
	DDX_Check(pDX, IDC_CHECK18, setcheck18);
	DDX_Check(pDX, IDC_CHECK19, setcheck19);
	DDX_Check(pDX, IDC_CHECK21, setcheck20);
	DDX_Check(pDX, IDC_CHECK22, setcheck21);
	DDX_Check(pDX, IDC_CHECK23, setcheck22);
	DDX_Check(pDX, IDC_CHECK24, setcheck23);
	DDX_Check(pDX, IDC_CHECK25, setcheck24);
	DDX_Text(pDX, IDC_EDIT11, outtime);
	DDX_Text(pDX, IDC_EDIT6, m_time3);
	DDX_Check(pDX, IDC_RESERVE1, reverse1);
	DDX_Check(pDX, IDC_RESERVE2, reverse2);
	DDX_Check(pDX, IDC_RESERVE3, reverse3);
	DDX_Check(pDX, IDC_RESERVE4, reverse4);
	DDX_Check(pDX, IDC_RESERVE5, reverse5);
	//}}AFX_DATA_MAP
	DDX_Check(pDX, IDC_CHECK26, setcheck25);
	DDX_Check(pDX, IDC_CHECK27, setcheck26);
}


BEGIN_MESSAGE_MAP(Set, CDialog)
	//{{AFX_MSG_MAP(Set)
	ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
	ON_BN_CLICKED(IDC_CHECK14, OnCheck14)
	ON_BN_CLICKED(IDC_CHECK15, OnCheck15)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON10, OnButton4)
	//}}AFX_MSG_MAP
	ON_BN_CLICKED(IDC_CHECK26,OnBnClickedCheck26)// vs2008����ʽON_BN_CLICKED(IDC_CHECK26,&Set::OnBnClickedCheck26)��������vc6.0
	ON_BN_CLICKED(IDC_CHECK27,OnBnClickedCheck27)
	ON_BN_CLICKED(IDC_RemoteChoosePhoto, OnBntRemoteChoosePhoto)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Set message handlers

BOOL Set::OnInitDialog() 
{
	CDialog::OnInitDialog();

	//AfxMessageBox("789");

	m_combo1.AddString ("��ѹ��");
	m_combo1.AddString ("3000x3000��������");
	m_combo1.AddString ("2000x2000��������");
	m_combo1.AddString ("1200x1200��������");
	m_combo1.AddString ("1000x1000��������");
	m_combo1.AddString ("800x800��������");
	m_combo1.AddString ("600x600��������");

	m_combo2.AddString ("��ѹ��");
	m_combo2.AddString ("3000x3000��������");
	m_combo2.AddString ("2000x2000��������");
	m_combo2.AddString ("1200x1200��������");
	m_combo2.AddString ("1000x1000��������");
	m_combo2.AddString ("800x800��������");
	m_combo2.AddString ("600x600��������");

	m_combo3.AddString ("��ѹ��");
	m_combo3.AddString ("3000x3000��������");
	m_combo3.AddString ("2000x2000��������");
	m_combo3.AddString ("1200x1200��������");
	m_combo3.AddString ("1000x1000��������");
	m_combo3.AddString ("800x800��������");
	m_combo3.AddString ("600x600��������");

	m_combo4.AddString ("��ѹ��");
	m_combo4.AddString ("3000x3000��������");
	m_combo4.AddString ("2000x2000��������");
	m_combo4.AddString ("1200x1200��������");
	m_combo4.AddString ("1000x1000��������");
	m_combo4.AddString ("800x800��������");
	m_combo4.AddString ("600x600��������");

	CString ziptype=g_cominfoarray.ElementAt(0).ElementAt(78);
	m_combo1.SetCurSel (m_combo1.FindString (0, ziptype));
	ziptype=g_cominfoarray.ElementAt(0).ElementAt(79);
	m_combo2.SetCurSel (m_combo2.FindString (0, ziptype));
	ziptype=g_cominfoarray.ElementAt(0).ElementAt(80);
	m_combo3.SetCurSel (m_combo3.FindString (0, ziptype));
	ziptype=g_cominfoarray.ElementAt(0).ElementAt(81);
	m_combo4.SetCurSel (m_combo4.FindString (0, ziptype));

	if(m_time1==0)m_time1=60;
	if(m_time2==0)m_time2=20;
	if(atoi(outtime)==0)outtime="30";

	if(g_cominfoarray.ElementAt(0).ElementAt(95)=="")setcheck13=1;
	// TODO: Add extra initialization here
	CString version = _T ("Version 1.0");
	m_check20=AfxGetApp()->GetProfileInt (version, "f2f3", 0);

	/*******************�˻�����ѡƬ������Ա��ҵ���鿴*******************/
	CString strVersion = _T("Version 1.0");
	setcheck25 = AfxGetApp()->GetProfileInt (strVersion, "status", 0);
#ifndef BASIC_VERSION
	setcheck26 = AfxGetApp()->GetProfileInt (strVersion, "status2", 0);
#else
	GetDlgItem(IDC_CHECK27)->ShowWindow(SW_HIDE);
#endif
	/******************************************************************/


	m_RemoteChoosePhoto = AfxGetApp()->GetProfileInt (strVersion, "RemoteChoosePhoto", 0);
	((CButton*)GetDlgItem(IDC_RemoteChoosePhoto))->SetCheck(m_RemoteChoosePhoto);

	UpdateData(false);
	OnCheck1();

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void Set::OnOK() //���水ť;
{
	UpdateData();
	CString sql;
	CString ziptype1,ziptype2,ziptype3,ziptype4;
	int pos;
	pos=m_combo1.GetCurSel ();
	if(pos!=-1)
		m_combo1.GetLBText (pos, ziptype1);
	pos=m_combo2.GetCurSel ();
	if(pos!=-1)
		m_combo2.GetLBText (pos, ziptype2);
	pos=m_combo3.GetCurSel ();
	if(pos!=-1)
		m_combo3.GetLBText (pos, ziptype3);
	pos=m_combo4.GetCurSel ();
	if(pos!=-1)
		m_combo4.GetLBText (pos, ziptype4);

	sql.Format("update version set [setcheck1]='%d',[setcheck2]='%d',[setcheck3]='%d',[setcheck4]='%d',[setcheck5]='%d',[setcheck6]='%d',[setcheck10]='%d',[setcheck11]='%d',[setcheck12]='%d',[setcheck13]='%d',[setcheck14]='%d',[setcheck15]='%d',[setcheck17]='%d',[setcheck18]='%d',[setcheck19]='%d',[setcheck20]='%d',[setcheck21]='%d',[setcheck22]='%d',[setcheck23]='%d',[setcheck24]='%d',[reverse1]='%d',[reverse2]='%d',[reverse3]='%d',[reverse4]='%d',[reverse5]='%d',[outtime]='%s',[time1]='%d',[time2]='%d',[time3]='%s',[printer1]='%s',[printer2]='%s',[printer3]='%s',[uploadcheck1]='%d',[uploadcheck2]='%d',[uploadcheck3]='%d',[uploadcheck4]='%d',[ziptype1]='%s',[ziptype2]='%s',[ziptype3]='%s',[ziptype4]='%s'", 
		setcheck1, setcheck2, setcheck3, setcheck4, setcheck5, setcheck6, setcheck10, setcheck11, setcheck12, setcheck13,setcheck14,setcheck15,setcheck17,setcheck18,setcheck19,setcheck20,setcheck21,setcheck22,setcheck23,setcheck24,reverse1,reverse2,reverse3,reverse4,reverse5,outtime,m_time1,m_time2,m_time3,m_printer1, m_printer2, m_printer3, m_uploadcheck1, m_uploadcheck2, m_uploadcheck3, m_uploadcheck4, ziptype1, ziptype2, ziptype3, ziptype4);
	
	g_sendhead.bsql=1;
	g_pMainWnd->ProcessChatMessageRequest2(sql);
	if(g_bSendOK==0)
		return;
	AfxMessageBox("����ɹ�!", MB_ICONINFORMATION);

	CString str;
	str.Format ("%d", setcheck1);
	g_cominfoarray.ElementAt(0).SetAt (58, str);
	str.Format ("%d", setcheck2);
	g_cominfoarray.ElementAt(0).SetAt (59, str);
	str.Format ("%d", setcheck3);
	g_cominfoarray.ElementAt(0).SetAt (60, str);
	str.Format ("%d", setcheck4);
	g_cominfoarray.ElementAt(0).SetAt (61, str);
	str.Format ("%d", setcheck5);
	g_cominfoarray.ElementAt(0).SetAt (62, str);
	str.Format ("%d", setcheck6);
	g_cominfoarray.ElementAt(0).SetAt (109, str);

	str.Format ("%d", setcheck10);
	g_cominfoarray.ElementAt(0).SetAt (76, str);
	str.Format ("%d", setcheck11);
	g_cominfoarray.ElementAt(0).SetAt (85, str);
	str.Format ("%d", setcheck12);
	g_cominfoarray.ElementAt(0).SetAt (86, str);

	str.Format ("%d", setcheck13);
	g_cominfoarray.ElementAt(0).SetAt (95, str);
	str.Format ("%d", setcheck14);
	g_cominfoarray.ElementAt(0).SetAt (99, str);
	str.Format ("%d", setcheck15);
	g_cominfoarray.ElementAt(0).SetAt (100, str);
	str.Format ("%d", setcheck17);
	g_cominfoarray.ElementAt(0).SetAt (113, str);
	str.Format ("%d", setcheck18);
	g_cominfoarray.ElementAt(0).SetAt (114, str);
	str.Format ("%d", setcheck19);
	g_cominfoarray.ElementAt(0).SetAt (115, str);
	str.Format ("%d", setcheck20);
	g_cominfoarray.ElementAt(0).SetAt (117, str);
	str.Format ("%d", setcheck21);
	g_cominfoarray.ElementAt(0).SetAt (121, str);
	str.Format ("%d", setcheck22);
	g_cominfoarray.ElementAt(0).SetAt (130, str);
	str.Format ("%d", setcheck23);
	g_cominfoarray.ElementAt(0).SetAt (131, str);
	str.Format ("%d", setcheck24);
	g_cominfoarray.ElementAt(0).SetAt (133, str);
	g_cominfoarray.ElementAt(0).SetAt (134, outtime);

	str.Format ("%d", reverse1);
	g_cominfoarray.ElementAt(0).SetAt (136, str);
	str.Format ("%d", reverse2);
	g_cominfoarray.ElementAt(0).SetAt (137, str);
	str.Format ("%d", reverse3);
	g_cominfoarray.ElementAt(0).SetAt (138, str);
	str.Format ("%d", reverse4);
	g_cominfoarray.ElementAt(0).SetAt (139, str);
	str.Format ("%d", reverse5);
	g_cominfoarray.ElementAt(0).SetAt (140, str);

	str.Format ("%d", m_time1);
	g_cominfoarray.ElementAt(0).SetAt (96, str);
	str.Format ("%d", m_time2);
	g_cominfoarray.ElementAt(0).SetAt (97, str);
	g_cominfoarray.ElementAt(0).SetAt (98, m_time3);

	str.Format ("%d", m_uploadcheck1);
	g_cominfoarray.ElementAt(0).SetAt (67, str);
	str.Format ("%d", m_uploadcheck2);
	g_cominfoarray.ElementAt(0).SetAt (68, str);
	str.Format ("%d", m_uploadcheck3);
	g_cominfoarray.ElementAt(0).SetAt (69, str);
	str.Format ("%d", m_uploadcheck4);
	g_cominfoarray.ElementAt(0).SetAt (70, str);
	if(g_branchname=="")
	{
		g_bSaveUploadTask1=atoi(g_cominfoarray.ElementAt(0).ElementAt(67));
		g_bSaveUploadTask2=atoi(g_cominfoarray.ElementAt(0).ElementAt(68));
		g_bSaveUploadTask3=atoi(g_cominfoarray.ElementAt(0).ElementAt(69));
		g_bSaveUploadTask4=atoi(g_cominfoarray.ElementAt(0).ElementAt(70));
	}

	g_cominfoarray.ElementAt(0).SetAt (63, m_printer1);
	g_cominfoarray.ElementAt(0).SetAt (64, m_printer2);
	g_cominfoarray.ElementAt(0).SetAt (65, m_printer3);

	g_cominfoarray.ElementAt(0).SetAt (78, ziptype1);
	g_cominfoarray.ElementAt(0).SetAt (79, ziptype2);
	g_cominfoarray.ElementAt(0).SetAt (80, ziptype3);
	g_cominfoarray.ElementAt(0).SetAt (81, ziptype4);

	CString strVersion = _T ("Version 1.0");
	BOOL bHide=atoi(g_cominfoarray.ElementAt(0).ElementAt(58));
	AfxGetApp()->WriteProfileInt (strVersion, "hidewindow2", bHide);

	AfxGetApp()->WriteProfileInt (strVersion, "f2f3", m_check20);
	g_pMainWnd->m_bCheckF2F3=m_check20;

	//*******************�˻�����ѡƬ��Ա��ҵ���鿴*****************************//
	AfxGetApp()->WriteProfileInt (strVersion, "status", setcheck25);
#ifndef BASIC_VERSION
	AfxGetApp()->WriteProfileInt (strVersion, "status2", setcheck26);
#endif
	//*******************�˻�����ѡƬ��Ա��ҵ���鿴*****************************//
	
	//���ѡƬ
	AfxGetApp()->WriteProfileInt (strVersion, "RemoteChoosePhoto", m_RemoteChoosePhoto);
	CDialog::OnOK();
}

void Set::OnCheck1() 
{
	// TODO: Add your control notification handler code here m_time3
	UpdateData();
	GetDlgItem(IDC_EDIT1)->EnableWindow(setcheck1==0);
	GetDlgItem(IDC_EDIT2)->EnableWindow(setcheck1==0);
	GetDlgItem(IDC_EDIT3)->EnableWindow(setcheck1==0);
}

void Set::OnCheck14() 
{
	// TODO: Add your control notification handler code here

}

void Set::OnCheck15() 
{
	// TODO: Add your control notification handler code here

}

void Set::OnButton1() 
{
	// TODO: Add your control notification handler code here
	UploadDes dlg;
	dlg.m_mode=0;
	dlg.DoModal ();
}

void Set::OnButton2() 
{
	// TODO: Add your control notification handler code here
	UploadDes dlg;
	dlg.m_mode=1;
	dlg.DoModal ();	
}

void Set::OnButton3() 
{
	// TODO: Add your control notification handler code here
	UploadDes dlg;
	dlg.m_mode=2;
	dlg.DoModal ();	
}

void Set::OnButton4() 
{
	// TODO: Add your control notification handler code here
	UploadDes dlg;
	dlg.m_mode=3;
	dlg.DoModal ();	
}

void Set::OnBnClickedCheck26()// �˻�����ѡƬ
{
#if 0
	UpdateData();
	if(g_user.bLongin==0)
	{
		if(g_bNoLoginLia)
		{
			Login dlg;
			dlg.SetLiaPath ("5.lia");
			dlg.DoModal();
		}
		else
		{	
			Login3 dlg;
			dlg.SetLiaPath ("5.lia");
			dlg.DoModal();
		}
		if(g_user.bLongin==0)return;
	}
#endif
#if 0	// Jeff:��Ӧ��������д����Ϣ��Ӧ���ڱ��水ťʱ��д��;
	CString strVersion = _T ("Version 1.0");
	if(setcheck25)
	{
		AfxGetApp()->WriteProfileInt (strVersion, "status2", 0);
	}
	else
	{
		AfxGetApp()->WriteProfileInt (strVersion, "status2", 1);
	}
#endif
}

void Set::OnBnClickedCheck27()// �˻�����Ա��ҵ���鿴
{
	UpdateData();
	if(g_user.bLongin==0) // �Ƿ��½ϵͳ;
	{
		if(g_bNoLoginLia)
		{
			Login dlg;
			dlg.SetLiaPath ("5.lia");
			dlg.DoModal();
		}
		else
		{	
			Login3 dlg;
			dlg.SetLiaPath ("5.lia");
			dlg.DoModal();
		}
		if(g_user.bLongin==0)return;
	}
	if(IsHasRightsnew(49)==0)
	{
		((CButton*)GetDlgItem(IDC_CHECK27))->SetCheck(FALSE);
		AfxMessageBox("����Ȩ������,����ϵ����Ա�������ã�");
		return;// �Ƿ���Ȩ�޽�������;
	}

	CString strVersion = _T ("Version 1.0");
RET:if(setcheck26==FALSE)
	{
		AfxGetApp()->WriteProfileInt (strVersion, "status2", 0);
		g_bStaffAchievementShow=0;

		TCHAR szKey[MAX_PATH];
		TCHAR szDir[MAX_PATH];
		::GetModuleFileName (NULL, szDir, MAX_PATH);
		HKEY hKey=0; 
		DWORD disp=0;
		lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); 
		int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp); 
		if(lResult==ERROR_SUCCESS)
		{
			RegDeleteValue(hKey,"YLGLMAINAUTORUN"); 
			RegDeleteKey (hKey,"YLGLMAINAUTORUN"); 
			RegCloseKey(hKey); 
		}
	}
	else
	{
		AfxGetApp()->WriteProfileInt (strVersion, "status2", 1);
		g_bStaffAchievementShow=1;

		TCHAR szKey[MAX_PATH];
		TCHAR szDir[MAX_PATH];
		::GetModuleFileName (NULL, szDir, MAX_PATH);
		HKEY hKey=0; 
		DWORD disp=0;
		lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); 
		int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp); 
		if(lResult==ERROR_SUCCESS)
		{ 
			lResult=RegSetValueEx(hKey,"YLGLMAINAUTORUN",0,REG_SZ,(const unsigned char*)szDir,lstrlen(szDir)); 
			RegCloseKey(hKey); 
		}
		StaffAchievementSet dlg;
		//dlg.DoModal();
		if ( dlg.DoModal() != IDOK )
		{
			setcheck26 = FALSE;
			((CButton*)GetDlgItem(IDC_CHECK27))->SetCheck(FALSE);
			UpdateData();
			goto RET;
		}
	}
}

// void Set::SetCancle()
//{
//	AfxGetApp()->WriteProfileInt ("Version 1.0", "status2", 0);
//	g_bStaffAchievementShow=0;
//
//	TCHAR szKey[MAX_PATH];
//	TCHAR szDir[MAX_PATH];
//	::GetModuleFileName (NULL, szDir, MAX_PATH);
//	HKEY hKey=0; 
//	DWORD disp=0;
//	lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); 
//	int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp); 
//	if(lResult==ERROR_SUCCESS)
//	{
//		RegDeleteValue(hKey,"YLGLMAINAUTORUN"); 
//		RegDeleteKey (hKey,"YLGLMAINAUTORUN"); 
//		RegCloseKey(hKey); 
//	}
//}

//���ѡƬ
void Set::OnBntRemoteChoosePhoto()
{
	m_RemoteChoosePhoto = !m_RemoteChoosePhoto;
}