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.

94 lines
2.7 KiB

  1. /******************************************************************************
  2. Header File: Profile Association Page.H
  3. Defines the class used to display the profile association sheet.
  4. Copyright (c) 1996 by Microsoft Corporation
  5. Change History:
  6. 05-09-97 hideyukn - Created
  7. ******************************************************************************/
  8. #include "PropPage.H"
  9. #include "Profile.H"
  10. // CProfileInformationPage class- this handles the Profile Information page(s)
  11. class CProfileAssociationPage: public CShellExtensionPage {
  12. CString m_csProfile;
  13. CProfile *m_pcpTarget;
  14. CUintArray m_cuaAdd; // Device associatins to be added
  15. CUintArray m_cuaDelete; // Device associations to zap
  16. CUintArray m_cuaAssociate; // Tentative list of associated devices
  17. BOOL m_bAssociationChanged;
  18. public:
  19. CProfileAssociationPage(HINSTANCE hiWhere, LPCTSTR lpstrTarget);
  20. ~CProfileAssociationPage();
  21. VOID ConstructAssociations();
  22. VOID UpdateDeviceListBox();
  23. virtual BOOL OnInit();
  24. virtual BOOL OnCommand(WORD wNotifyCode, WORD wid, HWND hwndControl);
  25. virtual BOOL OnNotify(int idCtrl, LPNMHDR pnmh);
  26. virtual BOOL OnDestroy();
  27. virtual BOOL OnHelp(LPHELPINFO pHelp);
  28. virtual BOOL OnContextMenu(HWND hwnd);
  29. HINSTANCE Instance() { return m_psp.hInstance; }
  30. CProfile * Profile() { return m_pcpTarget; }
  31. void Associate(unsigned uAdd);
  32. void Dissociate(unsigned uRemove);
  33. unsigned Association(unsigned u) {
  34. return m_cuaAssociate[u];
  35. }
  36. unsigned AssociationCount() const {
  37. return m_cuaAssociate.Count();
  38. }
  39. BOOL AssociationChanged() {
  40. return m_bAssociationChanged;
  41. }
  42. VOID DeviceListChanged() {
  43. ConstructAssociations();
  44. }
  45. LPCTSTR DisplayName(unsigned u) {
  46. return m_pcpTarget->DisplayName(m_cuaAssociate[u]);
  47. }
  48. };
  49. // The CAddDeviceDialog class handles the Add Device Dialog, which can be called
  50. // from the Association page.
  51. class CAddDeviceDialog: public CDialog {
  52. CProfileAssociationPage *m_pcpasBoss;
  53. HWND m_hwndList, m_hwndButton;
  54. BOOL m_bCanceled;
  55. public:
  56. CAddDeviceDialog(CProfileAssociationPage *pcpas, HWND hwndParent);
  57. virtual BOOL OnInit();
  58. virtual BOOL OnCommand(WORD wNotification, WORD wid, HWND hwndControl);
  59. virtual BOOL OnHelp(LPHELPINFO pHelp);
  60. virtual BOOL OnContextMenu(HWND hwnd);
  61. BOOL bCanceled() {return m_bCanceled;}
  62. };