Leaked source code of windows server 2003
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.

114 lines
3.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: A D V P A G E . H
  7. //
  8. // Contents: Advanced property page for Net Adapters
  9. //
  10. // Notes:
  11. //
  12. // Author: nabilr 11 Mar 1997
  13. //
  14. // History: BillBe (24 June 1997) took over ownership
  15. //
  16. //----------------------------------------------------------------------------
  17. #pragma once
  18. #include <ncxbase.h>
  19. #include "advanced.h"
  20. #include "param.h"
  21. #include "listbox.h"
  22. #include "ncatlps.h"
  23. #include "resource.h"
  24. // WM_USER message to call OnValidate method
  25. static const UINT c_msgValidate = WM_USER;
  26. enum CTLTYPE // ctl
  27. {
  28. CTLTYPE_UNKNOWN,
  29. CTLTYPE_SPIN,
  30. CTLTYPE_DROP,
  31. CTLTYPE_EDIT,
  32. CTLTYPE_NONE // use the present radio buttons only..
  33. };
  34. class CAdvanced: public CPropSheetPage, public CAdvancedParams
  35. {
  36. public:
  37. BEGIN_MSG_MAP(CAdvanced)
  38. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  39. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  40. MESSAGE_HANDLER(WM_HELP, OnHelp)
  41. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  42. COMMAND_ID_HANDLER(IDD_PARAMS_EDIT, OnEdit)
  43. COMMAND_ID_HANDLER(IDD_PARAMS_DROP, OnDrop)
  44. COMMAND_ID_HANDLER(IDD_PARAMS_PRESENT, OnPresent)
  45. COMMAND_ID_HANDLER(IDD_PARAMS_NOT_PRESENT, OnPresent)
  46. COMMAND_ID_HANDLER(IDD_PARAMS_LIST, OnList)
  47. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  48. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  49. END_MSG_MAP()
  50. CAdvanced ();
  51. ~CAdvanced();
  52. VOID DestroyPageCallbackHandler()
  53. {
  54. delete this;
  55. }
  56. BOOL FValidateAllParams(BOOL fDisplayUI);
  57. VOID Apply();
  58. HPROPSHEETPAGE CreatePage(HDEVINFO hdi, PSP_DEVINFO_DATA pdeid);
  59. // ATL message handlers
  60. LRESULT OnApply(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  61. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  62. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam,
  63. BOOL& fHandled);
  64. LRESULT OnEdit(WORD wNotifyCode, WORD wID,
  65. HWND hWndCtl, BOOL& fHandled);
  66. LRESULT OnDrop(WORD wNotifyCode, WORD wID,
  67. HWND hWndCtl, BOOL& fHandled);
  68. LRESULT OnPresent(WORD wNotifyCode, WORD wID,
  69. HWND hWndCtl, BOOL& fHandled);
  70. LRESULT OnList(WORD wNotifyCode, WORD wID,
  71. HWND hWndCtl, BOOL& fHandled);
  72. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  73. LPARAM lParam, BOOL& fHandled);
  74. LRESULT OnDestroy(UINT uMsg, WPARAM wParam,
  75. LPARAM lParam, BOOL& fHandled);
  76. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  77. private:
  78. // UI controls
  79. CListBox * m_plbParams; // see listbox.h for class defn
  80. CEdit * m_pedtEdit; // see listbox.h for class defn
  81. CComboBox * m_pcbxDrop; // see listbox.h for class defn
  82. CButton * m_pbmPresent; // present radio button
  83. CButton * m_pbmNotPresent; // not present radio button
  84. HWND m_hwndSpin; // spin control
  85. HWND m_hwndPresentText; // Text for use with KeyOnly type
  86. HKEY m_hkRoot; // instance root
  87. int m_nCurSel; // current item
  88. CTLTYPE m_ctlControlType; // control type
  89. CValue m_vCurrent; // control param value
  90. BOOL m_fInitializing;
  91. // private methods
  92. VOID FillParamListbox();
  93. VOID SelectParam();
  94. VOID SetParamRange();
  95. VOID UpdateParamDisplay();
  96. VOID UpdateDisplay();
  97. VOID GetParamValue();
  98. int EnumvalToItem(const PWSTR psz);
  99. int ItemToEnumval(int iItem, PWSTR psz, UINT cb);
  100. VOID BeginEdit();
  101. BOOL FValidateCurrParam();
  102. };