HideWindow.cpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 rights=AfxGetApp()->GetProfileString (LYFZVERSION, "hidewindow", "");
  37. if(rights.IsEmpty ())rights="111111111111111";
  38. CStringArray array;
  39. array.Add (_T("门市流程"));
  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. for(int i=0; i<array.GetSize (); i++)
  51. {
  52. GetDlgItem(IDC_CHECK1+i)->SetWindowText (array.ElementAt (i));
  53. if(rights.Mid (i,1)=="1")
  54. ((CButton*)GetDlgItem(IDC_CHECK1+i))->SetCheck(1);
  55. }
  56. // TODO: Add extra initialization here
  57. return TRUE; // return TRUE unless you set the focus to a control
  58. // EXCEPTION: OCX Property Pages should return FALSE
  59. }
  60. void HideWindow::OnOK()
  61. {
  62. // TODO: Add extra validation here
  63. CString ret,temp;
  64. for(int i=0; i<15; i++)
  65. {
  66. temp.Format ("%d",((CButton*)GetDlgItem(IDC_CHECK1+i))->GetCheck());
  67. ret+=temp;
  68. }
  69. AfxGetApp()->WriteProfileString (LYFZVERSION, "hidewindow", ret);
  70. MessageBox("保存成功,重启软件生效!");
  71. CDialog::OnOK();
  72. }