Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.2 KiB

  1. // PageIni.h : Declaration of the CPageIni
  2. #ifndef __PAGEINI_H_
  3. #define __PAGEINI_H_
  4. #include "resource.h" // main symbols
  5. #include <atlhost.h>
  6. #include "msconfigstate.h"
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CPageIni
  9. class CPageIni :
  10. public CAxDialogImpl<CPageIni>
  11. {
  12. public:
  13. CPageIni()
  14. {
  15. }
  16. ~CPageIni()
  17. {
  18. }
  19. enum { IDD = IDD_PAGEINI };
  20. BEGIN_MSG_MAP(CPageIni)
  21. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  22. END_MSG_MAP()
  23. // Handler prototypes:
  24. // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  25. // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  26. // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  27. private:
  28. CString m_strCaption; // contains the localized name of this page
  29. CString m_strINIFile; // the INI file this page is editing
  30. public:
  31. //-------------------------------------------------------------------------
  32. // Functions used by the parent dialog.
  33. //-------------------------------------------------------------------------
  34. BOOL IsValid(CMSConfigState * state, LPCTSTR szINIFile)
  35. {
  36. m_strINIFile = szINIFile;
  37. return TRUE;
  38. }
  39. LPCTSTR GetCaption()
  40. {
  41. if (m_strCaption.IsEmpty())
  42. {
  43. ::AfxSetResourceHandle(_Module.GetResourceInstance());
  44. if (m_strINIFile.CompareNoCase(_T("win.ini")) == 0)
  45. m_strCaption.LoadString(IDS_WININI_CAPTION);
  46. else
  47. m_strCaption.LoadString(IDS_SYSTEMINI_CAPTION);
  48. }
  49. return m_strCaption;
  50. }
  51. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  52. {
  53. ::EnableWindow(GetDlgItem(IDC_INITREE), FALSE);
  54. ::EnableWindow(GetDlgItem(IDC_BUTTONSEARCH), FALSE);
  55. ::EnableWindow(GetDlgItem(IDC_BUTTONINIMOVEUP), FALSE);
  56. ::EnableWindow(GetDlgItem(IDC_BUTTONINIMOVEDOWN), FALSE);
  57. ::EnableWindow(GetDlgItem(IDC_BUTTONINIENABLE), FALSE);
  58. ::EnableWindow(GetDlgItem(IDC_BUTTONINIDISABLE), FALSE);
  59. ::EnableWindow(GetDlgItem(IDC_BUTTONININEW), FALSE);
  60. ::EnableWindow(GetDlgItem(IDC_BUTTONINIEDIT), FALSE);
  61. ::EnableWindow(GetDlgItem(IDC_BUTTONINIENABLEALL), FALSE);
  62. ::EnableWindow(GetDlgItem(IDC_BUTTONINIDISABLEALL), FALSE);
  63. return 0;
  64. }
  65. };
  66. #endif //__PAGEINI_H_