00001 /****************************************************************************** 00002 00003 Header File: Profile Association Page.H 00004 00005 Defines the class used to display the profile association sheet. 00006 00007 Copyright (c) 1996 by Microsoft Corporation 00008 00009 Change History: 00010 00011 05-09-97 hideyukn - Created 00012 00013 ******************************************************************************/ 00014 00015 #include "PropPage.H" 00016 #include "Profile.H" 00017 00018 // CProfileInformationPage class- this handles the Profile Information page(s) 00019 00020 class CProfileAssociationPage: public CShellExtensionPage { 00021 00022 CString m_csProfile; 00023 00024 CProfile *m_pcpTarget; 00025 00026 CUintArray m_cuaAdd; // Device associatins to be added 00027 CUintArray m_cuaDelete; // Device associations to zap 00028 00029 CUintArray m_cuaAssociate; // Tentative list of associated devices 00030 00031 BOOL m_bAssociationChanged; 00032 00033 public: 00034 00035 CProfileAssociationPage(HINSTANCE hiWhere, LPCTSTR lpstrTarget); 00036 ~CProfileAssociationPage(); 00037 00038 VOID ConstructAssociations(); 00039 VOID UpdateDeviceListBox(); 00040 00041 virtual BOOL OnInit(); 00042 virtual BOOL OnCommand(WORD wNotifyCode, WORD wid, HWND hwndControl); 00043 virtual BOOL OnNotify(int idCtrl, LPNMHDR pnmh); 00044 virtual BOOL OnDestroy(); 00045 00046 virtual BOOL OnHelp(LPHELPINFO pHelp); 00047 virtual BOOL OnContextMenu(HWND hwnd); 00048 00049 HINSTANCE Instance() { return m_psp.hInstance; } 00050 00051 CProfile * Profile() { return m_pcpTarget; } 00052 00053 void Associate(unsigned uAdd); 00054 void Dissociate(unsigned uRemove); 00055 unsigned Association(unsigned u) { 00056 return m_cuaAssociate[u]; 00057 } 00058 unsigned AssociationCount() const { 00059 return m_cuaAssociate.Count(); 00060 } 00061 BOOL AssociationChanged() { 00062 return m_bAssociationChanged; 00063 } 00064 00065 VOID DeviceListChanged() { 00066 ConstructAssociations(); 00067 } 00068 00069 LPCTSTR DisplayName(unsigned u) { 00070 return m_pcpTarget->DisplayName(m_cuaAssociate[u]); 00071 } 00072 }; 00073 00074 00075 // The CAddDeviceDialog class handles the Add Device Dialog, which can be called 00076 // from the Association page. 00077 00078 class CAddDeviceDialog: public CDialog { 00079 CProfileAssociationPage *m_pcpasBoss; 00080 HWND m_hwndList, m_hwndButton; 00081 BOOL m_bCanceled; 00082 00083 public: 00084 00085 CAddDeviceDialog(CProfileAssociationPage *pcpas, HWND hwndParent); 00086 00087 virtual BOOL OnInit(); 00088 virtual BOOL OnCommand(WORD wNotification, WORD wid, HWND hwndControl); 00089 00090 virtual BOOL OnHelp(LPHELPINFO pHelp); 00091 virtual BOOL OnContextMenu(HWND hwnd); 00092 00093 BOOL bCanceled() {return m_bCanceled;} 00094 };