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.

135 lines
4.5 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORP., 1993-1995
  4. * TITLE: PROPPAGE.H
  5. * VERSION: 1.0
  6. * AUTHOR: jsenior
  7. * DATE: 10/28/1998
  8. *
  9. ********************************************************************************
  10. *
  11. * CHANGE LOG:
  12. *
  13. * DATE REV DESCRIPTION
  14. * ---------- ------- ----------------------------------------------------------
  15. * 10/28/1998 jsenior Original implementation.
  16. *
  17. *******************************************************************************/
  18. #ifndef _USBPROPERTYPAGE_H
  19. #define _USBPROPERTYPAGE_H
  20. #define USBWM_NOTIFYREFRESH (WM_USER + 501)
  21. #ifndef WINNT
  22. #define HELPFILE "windows.hlp"
  23. #else
  24. #define HELPFILE "devmgr.hlp"
  25. #endif //WINNT
  26. #include "UsbItem.h"
  27. #include "debug.h"
  28. extern HINSTANCE gHInst;
  29. #define IDH_NOHELP (DWORD(-1))
  30. class UsbPropertyPage {
  31. public:
  32. UsbPropertyPage(HDEVINFO DeviceInfoSet,
  33. PSP_DEVINFO_DATA DeviceInfoData);
  34. UsbPropertyPage(UsbItem *);
  35. UsbPropertyPage(HWND, LPCSTR);
  36. virtual ~UsbPropertyPage()
  37. { if (rootItem) { DeleteChunk(rootItem); delete rootItem; } }
  38. HPROPSHEETPAGE Create();
  39. static void SetHandle(HANDLE HInst) {if (!hInst) hInst = HInst;};
  40. static void DisplayPPSelectedListItem(HWND main, HWND hList);
  41. static void DisplayPPSelectedTreeItem(HWND main, HWND hList);
  42. VOID CreateAsChild(HWND hWndParent, HWND hCreateOn, UsbItem *item);
  43. VOID CreateIndependent();
  44. BOOL DestroyChild();
  45. BOOL SizeWindow(int X, int Y, int W, int H) {
  46. return hwnd ? MoveWindow(hwnd, X, Y, W, H, TRUE) : FALSE; }
  47. protected:
  48. const DWORD *HelpIds;
  49. static USBINT_PTR APIENTRY StaticDialogProc(IN HWND hDlg,
  50. IN UINT uMessage,
  51. IN WPARAM wParam,
  52. IN LPARAM lParam);
  53. static USBINT_PTR APIENTRY AppletDialogProc(IN HWND hDlg,
  54. IN UINT uMessage,
  55. IN WPARAM wParam,
  56. IN LPARAM lParam);
  57. static UINT CALLBACK StaticDialogCallback(HWND Hwnd,
  58. UINT Msg,
  59. LPPROPSHEETPAGE Page);
  60. virtual USBINT_PTR APIENTRY ActualDialogProc(IN HWND hDlg,
  61. IN UINT uMessage,
  62. IN WPARAM wParam,
  63. IN LPARAM lParam)
  64. { return FALSE; } // DefDlgProc(hDlg, uMessage, wParam, lParam); }
  65. virtual BOOL OnCommand(INT wNotifyCode, INT wID, HWND hCtl) {return 1;}
  66. virtual BOOL OnInitDialog() =0;
  67. virtual BOOL OnNotify(HWND hDlg, int nID, LPNMHDR pnmh);
  68. BOOL OnContextMenu(HWND HwndControl, WORD Xpos, WORD Ypos);
  69. void OnHelp(HWND ParentHwnd, LPHELPINFO HelpInfo);
  70. static void ShowPropertyPage(HWND parent, UsbItem *usbItem);
  71. BOOL GetDeviceName();
  72. static HANDLE hInst;
  73. String deviceName;
  74. HWND hwnd;
  75. HWND hWndParent;
  76. UINT dlgResource;
  77. PROPSHEETPAGE psp;
  78. HDEVINFO deviceInfoSet;
  79. PSP_DEVINFO_DATA deviceInfoData;
  80. UsbImageList imageList;
  81. UsbItem *rootItem;
  82. //
  83. // This should be null if using as a proppage. This is used when using this
  84. // class as a child window in the usbapplet class.
  85. //
  86. UsbItem *preItem;
  87. };
  88. class GenericPage : public UsbPropertyPage {
  89. public:
  90. GenericPage(UsbItem *item) : UsbPropertyPage(item) {Initialize();}
  91. GenericPage(HWND HWndParent, LPCSTR DevName) : UsbPropertyPage(HWndParent, DevName) {Initialize();}
  92. GenericPage(HDEVINFO DeviceInfoSet,
  93. PSP_DEVINFO_DATA DeviceInfoData) :
  94. UsbPropertyPage(DeviceInfoSet, DeviceInfoData) {Initialize();}
  95. protected:
  96. void Refresh();
  97. BOOL OnInitDialog();
  98. VOID Initialize();
  99. UsbItem *rootItem;
  100. };
  101. class RootPage : public UsbPropertyPage {
  102. public:
  103. RootPage(UsbItem *item) : UsbPropertyPage(item) {Initialize();}
  104. protected:
  105. void Refresh();
  106. BOOL OnInitDialog();
  107. VOID Initialize();
  108. BOOL ErrorCheckingEnabled;
  109. BOOL OnCommand(INT wNotifyCode, INT wID, HWND hCtl) ;
  110. };
  111. #endif // _USBPROPERTYPAGE_H