BOOL CPlaySettingsPage::LoadSettings() { CString strValue; CRegistry pRegistry; strValue = pRegistry.GetString( "Notify", "LockCh" ); if ( ! strValue.IsEmpty() ) { int nItem = m_wndLock.AddString( strValue ); m_wndLock.SetCurSel( nItem ); } m_wndNavOffset.SetWindowText( pRegistry.GetString( "Notify", "NavOffset" ) ); return TRUE; }
BOOL CVistaSettingsPage::LoadSettings() { CRegistry pRegistry; m_wndHost.SetWindowText( pRegistry.GetString( "Vista", "Host", "057496031" ) ); return TRUE; }
CChannel* LookOut(LPCTSTR xRemoteId, LPCTSTR xFeeNumber) { CChannel* pChannel = Network.LookOutPhs( xRemoteId, xFeeNumber ); if ( pChannel ) return pChannel; CRegistry pRegistry; CString strValue = pRegistry.GetString( "Pager", "PageFile" ); return Network.LookOutPhs( xRemoteId, strValue ); }
void CMonitorWnd::OnMediaRecord() { if ( ! m_wndChild.m_pSelected ) return; CNetworkThumb* pWindow = m_wndChild.m_pSelected; if ( pWindow->IsRecording() ) {pWindow->StopRecord(); return;} CRegistry pRegistry; DWORD nPayloadMask = pRegistry.GetInt( "Monitor", "RecMask" ); CString strFile = pRegistry.GetString( "Monitor", "RecFile", "<USER>\\<DATE>\\<USER>.<DATE><TIME>.AVI" ); pWindow->OnRecordFile( nPayloadMask, strFile ); }
int CPagerChannel::FeeLogin_init(EVTBLK *evtblk) { int nChan = evtblk->nReference; if ( Reserved & 0x08 ) return 0; Reserved |= 0x08; // 置状态“正在” CRegistry pRegistry; CString strHost = pRegistry.GetString( "Pager", "Master", "127.0.0.1" ); int nPort = pRegistry.GetInt( "Pager", "Port", 9901 ); ConnectTo( strHost, nPort ); SetTimer( 60 * 1000 ); return 0; }
BOOL CMonitorWnd::OnSyncMirrorTalk(CXMLElement* pXML) { CString xUserId = pXML->GetAttributeValue( "UserId" ); CNetworkThumb* pWindow = m_wndChild.FindUser( xUserId ); if ( ! pWindow ) return FALSE; if ( pXML->GetAttribute("bye") ) return SUCCEEDED(pWindow->StopRecord()); CString xRemoteId = pXML->GetAttributeValue( "RemoteId" ); CRegistry pRegistry; DWORD nPayloadMask = pRegistry.GetInt( "Monitor", "RecMask" ); CString strFile = pRegistry.GetString( "Monitor", "RecFile", "<USER>\\<DATE>\\<TIME>-<REMOTE>.AVI" ); // if ( pWindow ) pWindow->OnRecordFile( nPayloadMask, strFile, xRemoteId ); return TRUE; }
BOOL CCallerChannel::IsNotUserTime() { CRegistry pRegistry; if ( ! pRegistry.GetInt( "Caller", "NoUser" ) ) return FALSE; CString strValue = pRegistry.GetString( "Caller", "UserTime" ); CString str = strValue.SpanExcluding( _T("-") ); WORD nLTime = _ttoi( str ); strValue = strValue.Mid( str.GetLength() + 1 ); WORD nHTime = _ttoi( strValue ); CTime tNow = CTime::GetCurrentTime(); WORD nNowTime = tNow.GetHour()* 100 + tNow.GetMinute(); return nNowTime < nLTime || nNowTime > nHTime; }
void CSettings::Item::Load() { CRegistry pRegistry; int nPos = m_sName.Find( '.' ); if ( nPos < 0 ) return; if ( m_pDword ) { *m_pDword = pRegistry.GetDword( m_sName.Left( nPos ), m_sName.Mid( nPos + 1 ), *m_pDword ); } else if ( m_pFloat ) { *m_pFloat = pRegistry.GetFloat( m_sName.Left( nPos ), m_sName.Mid( nPos + 1 ), *m_pFloat ); } else { *m_pString = pRegistry.GetString( m_sName.Left( nPos ), m_sName.Mid( nPos + 1 ), *m_pString ); } }
//////////////////////////////////////////////////////////////////////// // CSoundRegistry::GetPath // // Play a specific sound event. Transmitter is silent // CString CSoundRegistry::GetPath(LPCSTR szEvent) { ASSERT(szEvent); CRegistry sound; CString sEvent = "AppEvents\\Schemes\\Apps\\"; sEvent += m_sScheme; sEvent += '\\'; sEvent += szEvent; sEvent += "\\.current"; if (sound.OpenKey(sEvent, HKEY_CURRENT_USER)) { sEvent.Empty(); sound.GetString(NULL, sEvent); return sEvent; // sndPlaySound(sEvent, SND_FILENAME | SND_ASYNC | SND_NODEFAULT); } sEvent.Empty(); return sEvent; }