HideWindow.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // HideWindow.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "HideWindow.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // HideWindow dialog
  13. HideWindow::HideWindow(CWnd* pParent /*=NULL*/)
  14. : CDialog(HideWindow::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(HideWindow)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. }
  20. void HideWindow::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(HideWindow)
  24. // NOTE: the ClassWizard will add DDX and DDV calls here
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(HideWindow, CDialog)
  28. //{{AFX_MSG_MAP(HideWindow)
  29. //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31. /////////////////////////////////////////////////////////////////////////////
  32. // HideWindow message handlers
  33. BOOL HideWindow::OnInitDialog()
  34. {
  35. CDialog::OnInitDialog();
  36. CString version = _T ("Version 1.0");
  37. CString rights=AfxGetApp()->GetProfileString (version, "hidewindow", "");
  38. if(rights.IsEmpty ())rights="111111111111111";
  39. CStringArray array;
  40. array.Add (_T("门市流程"));
  41. array.Add(_T("财务管理"));
  42. array.Add(_T("统计查询"));
  43. //array.Add(_T("短信群发"));
  44. array.Add(_T("短信管理"));
  45. array.Add(_T("会员管理"));
  46. array.Add(_T("礼服管理"));
  47. array.Add(_T("库存管理"));
  48. array.Add(_T("客户管理"));
  49. array.Add(_T("来电精灵"));
  50. array.Add(_T("员工考勤"));
  51. for(int i=0; i<array.GetSize (); i++)
  52. {
  53. GetDlgItem(IDC_CHECK1+i)->SetWindowText (array.ElementAt (i));
  54. if(rights.Mid (i,1)=="1")
  55. ((CButton*)GetDlgItem(IDC_CHECK1+i))->SetCheck(1);
  56. }
  57. // TODO: Add extra initialization here
  58. return TRUE; // return TRUE unless you set the focus to a control
  59. // EXCEPTION: OCX Property Pages should return FALSE
  60. }
  61. void HideWindow::OnOK()
  62. {
  63. // TODO: Add extra validation here
  64. CString ret,temp;
  65. for(int i=0; i<15; i++)
  66. {
  67. temp.Format ("%d",((CButton*)GetDlgItem(IDC_CHECK1+i))->GetCheck());
  68. ret+=temp;
  69. }
  70. CString version = _T ("Version 1.0");
  71. AfxGetApp()->WriteProfileString (version, "hidewindow", ret);
  72. MessageBox("保存成功,重启软件生效!");
  73. CDialog::OnOK();
  74. }