Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CMonitorList Class Reference

#include <profile.h>

Inheritance diagram for CMonitorList:

CDeviceList List of all members.

Public Member Functions

 CMonitorList ()
 ~CMonitorList ()
virtual unsigned Count ()
virtual CStringDeviceName (unsigned u)
virtual CStringDisplayName (unsigned u)
virtual CStringPrimaryDeviceName ()
virtual void Enumerate ()
virtual BOOL IsValidDeviceName (LPCTSTR lpstr)
virtual LPCSTR DeviceNameToDisplayName (LPCTSTR lpstr)

Private Attributes

CStringArray m_csaDeviceNames
CStringArray m_csaDisplayNames
CString m_csPrimaryDeviceName

Constructor & Destructor Documentation

CMonitorList::CMonitorList  )  [inline]
 

Definition at line 101 of file icmui/profile.h.

00101 {}

CMonitorList::~CMonitorList  )  [inline]
 

Definition at line 102 of file icmui/profile.h.

00102 {}


Member Function Documentation

virtual unsigned CMonitorList::Count  )  [inline, virtual]
 

Reimplemented from CDeviceList.

Definition at line 104 of file icmui/profile.h.

References CStringArray::Count(), and m_csaDeviceNames.

Referenced by CICMUserInterface::AddMonitorTab(), DeviceNameToDisplayName(), CAllDeviceList::Enumerate(), and IsValidDeviceName().

00104 { return m_csaDeviceNames.Count(); }

virtual CString& CMonitorList::DeviceName unsigned  u  )  [inline, virtual]
 

Reimplemented from CDeviceList.

Definition at line 105 of file icmui/profile.h.

References DeviceName(), and m_csaDeviceNames.

Referenced by CICMUserInterface::AddMonitorTab(), DeviceName(), and CAllDeviceList::Enumerate().

00105 { return m_csaDeviceNames[u]; }

LPCSTR CMonitorList::DeviceNameToDisplayName LPCTSTR  lpstr  )  [virtual]
 

Definition at line 224 of file profile.cpp.

References Count(), DeviceNameToDisplayName(), Enumerate(), m_csaDeviceNames, m_csaDisplayNames, and NULL.

Referenced by CColorMatchDialog::CompleteInitialization(), and DeviceNameToDisplayName().

00224 { 00225 00226 if (!lpstrRef) return NULL; 00227 00228 if (!Count()) 00229 Enumerate(); 00230 00231 for (unsigned u = 0; u < Count(); u++) 00232 if (!lstrcmpi(m_csaDeviceNames[u], lpstrRef)) 00233 return (LPCSTR)(m_csaDisplayNames[u]); 00234 00235 return NULL; 00236 }

virtual CString& CMonitorList::DisplayName unsigned  u  )  [inline, virtual]
 

Reimplemented from CDeviceList.

Definition at line 106 of file icmui/profile.h.

References DisplayName(), and m_csaDisplayNames.

Referenced by DisplayName(), and CAllDeviceList::Enumerate().

00106 { return m_csaDisplayNames[u]; }

void CMonitorList::Enumerate  )  [virtual]
 

Reimplemented from CDeviceList.

Definition at line 159 of file profile.cpp.

References CStringArray::Add(), EnumDisplayDevices(), m_csaDeviceNames, m_csaDisplayNames, m_csPrimaryDeviceName, and NULL.

Referenced by CICMUserInterface::AddMonitorTab(), CColorMatchDialog::CompleteInitialization(), DeviceNameToDisplayName(), CAllDeviceList::Enumerate(), and IsValidDeviceName().

00159 { 00160 00161 ULONG ulSerialNumber = 1; 00162 ULONG ulDeviceIndex = 0; 00163 DISPLAY_DEVICE ddPriv; 00164 00165 ddPriv.cb = sizeof(ddPriv); 00166 00167 // Enumurate display adaptor on the system. 00168 00169 while (EnumDisplayDevices(NULL, ulDeviceIndex, &ddPriv, 0)) 00170 { 00171 ULONG ulMonitorIndex = 0; 00172 DISPLAY_DEVICE ddPrivMonitor; 00173 00174 ddPrivMonitor.cb = sizeof(ddPrivMonitor); 00175 00176 // then, enumurate monitor device, attached the display adaptor. 00177 00178 while (EnumDisplayDevices(ddPriv.DeviceName, ulMonitorIndex, &ddPrivMonitor, 0)) 00179 { 00180 TCHAR DisplayNameBuf[256]; // number: devicename - 256 is good enough. 00181 00182 // Insert PnP id as device name. 00183 00184 m_csaDeviceNames.Add(ddPrivMonitor.DeviceID); 00185 00186 // If this is primary display device, remember it. 00187 00188 if (ddPriv.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) 00189 { 00190 m_csPrimaryDeviceName = ddPrivMonitor.DeviceID; 00191 } 00192 00193 // Build display name. 00194 00195 wsprintf(DisplayNameBuf,TEXT("%d. %s"),ulSerialNumber,ddPrivMonitor.DeviceString); 00196 m_csaDisplayNames.Add(DisplayNameBuf); 00197 00198 ulMonitorIndex++; 00199 ulSerialNumber++; 00200 ddPrivMonitor.cb = sizeof(ddPrivMonitor); 00201 } 00202 00203 ulDeviceIndex++; 00204 ddPriv.cb = sizeof(ddPriv); 00205 } 00206 }

BOOL CMonitorList::IsValidDeviceName LPCTSTR  lpstr  )  [virtual]
 

Reimplemented from CDeviceList.

Definition at line 210 of file profile.cpp.

References BOOL, Count(), Enumerate(), FALSE, IsValidDeviceName(), and m_csaDeviceNames.

Referenced by CColorMatchDialog::CompleteInitialization(), and IsValidDeviceName().

00210 { 00211 00212 if (!lpstrRef) return FALSE; 00213 00214 if (!Count()) 00215 Enumerate(); 00216 00217 for (unsigned u = 0; u < Count(); u++) 00218 if (!lstrcmpi(m_csaDeviceNames[u], lpstrRef)) 00219 break; 00220 00221 return u < Count(); 00222 }

virtual CString& CMonitorList::PrimaryDeviceName  )  [inline, virtual]
 

Definition at line 108 of file icmui/profile.h.

References m_csPrimaryDeviceName.

Referenced by CColorMatchDialog::CompleteInitialization().

00108 { return m_csPrimaryDeviceName; }


Member Data Documentation

CStringArray CMonitorList::m_csaDeviceNames [private]
 

Definition at line 95 of file icmui/profile.h.

Referenced by Count(), DeviceName(), DeviceNameToDisplayName(), Enumerate(), and IsValidDeviceName().

CStringArray CMonitorList::m_csaDisplayNames [private]
 

Definition at line 96 of file icmui/profile.h.

Referenced by DeviceNameToDisplayName(), DisplayName(), and Enumerate().

CString CMonitorList::m_csPrimaryDeviceName [private]
 

Definition at line 98 of file icmui/profile.h.

Referenced by Enumerate(), and PrimaryDeviceName().


The documentation for this class was generated from the following files:
Generated on Sat May 15 19:46:27 2004 for test by doxygen 1.3.7