扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
DWORD WINAPI SipStatus(); BOOL WINAPI SipSetDefaultRect(RECT *); BOOL WINAPI SipRegisterNotification(HWND); BOOL WINAPI SipShowIM(DWORD); BOOL WINAPI SipGetInfo(SIPINFO *); BOOL WINAPI SipSetInfo(SIPINFO *); int WINAPI SipEnumIM(IMENUMPROC); BOOL WINAPI SipGetCurrentIM(CLSID *); BOOL WINAPI SipSetCurrentIM(CLSID *); |
CTypedPtrMap<CMapStringToPtr,CString,CLSID*> g_SipMap; int SipEnumIMProc(IMENUMINFO *pIMInfo) { CLSID* pCLSID = new CLSID; memcpy(pCLSID,&pIMInfo->clsid,sizeof(CLSID)); g_SipMap.SetAt(CString(pIMInfo->szName),pCLSID); TRACE(_T("%sn"),CString(pIMInfo->szName)); return 1; } void CSIPDemoDlg::OnButtonEnum() { SipEnumIM(SipEnumIMProc); CString sSipName; CLSID *pCLSID = NULL; for (POSITION pos = g_SipMap.GetStartPosition(); pos; ) { g_SipMap.GetNextAssoc(pos,sSipName,pCLSID); m_SipList.AddString(sSipName); } } |
void CSIPDemoDlg::OnButtonEnum() { SipEnumIM(SipEnumIMProc); CLSID CurrSip; SipGetCurrentIM(&CurrSip); int nCurrSip = LB_ERR, nSipCount = 0; CString sSipName, sCurrSipName; CLSID *pCLSID = NULL; for (POSITION pos = g_SipMap.GetStartPosition(); pos; ) { g_SipMap.GetNextAssoc(pos,sSipName,pCLSID); m_SipList.AddString(sSipName); if ( memcmp(&CurrSip,pCLSID,sizeof(CLSID)) == 0 ) { nCurrSip = nSipCount; sCurrSipName = sSipName; } nSipCount++; } m_SipList.SelectString(0,sCurrSipName); } void CSIPDemoDlg::OnButtonSelect() { int nSel = m_SipList.GetCurSel(); if ( LB_ERR == nSel ) return; CString sSipName; m_SipList.GetText(nSel,sSipName); CLSID *pCLSID = NULL; if ( !g_SipMap.Lookup(sSipName,pCLSID) ) return; BOOL bRes = SipSetCurrentIM(pCLSID); if ( !bRes ) TRACE(L"SipSetCurrentIM returned %lun",GetLastError()); } void CSIPDemoDlg::OnButtonShowHide() { if ( !g_bShow ) { SipShowIM(SIPF_ON); g_bShow = TRUE; } else { SipShowIM(SIPF_OFF); g_bShow = FALSE; } } void CSIPDemoDlg::OnButtonShowHide2() { SIPINFO SipInfo; memset(&SipInfo,0,sizeof(SipInfo)); SipInfo.cbSize=sizeof(SIPINFO); BOOL bRes = SipGetInfo(&SipInfo); if ( bRes ) { if ( !g_bShow ) { SipInfo.fdwFlags |= SIPF_ON; g_bShow = TRUE; } else { SipInfo.fdwFlags = SIPF_OFF; g_bShow = FALSE; } bRes = SipSetInfo(&SipInfo); } else { TRACE(L"SipGetInfo returned %lun",GetLastError()); } } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者