本文整理汇总了C++中CGameManager::Get_GameIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameManager::Get_GameIcon方法的具体用法?C++ CGameManager::Get_GameIcon怎么用?C++ CGameManager::Get_GameIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameManager
的用法示例。
在下文中一共展示了CGameManager::Get_GameIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NotifyBuddyIsOnline
void CBuddyManager::NotifyBuddyIsOnline(BUDDY_INFO *pBI, SERVER_INFO *pServerInfo)
{
if(pBI==NULL)
return;
if(pServerInfo==NULL)
return;
vecBI::iterator it = FindBuddyInfoByID(pBI->dwID);
if(it==BuddyList.end())
return;
if(pServerInfo->szServerName!=NULL)
strncpy_s(it->szServerName,sizeof(pBI->szServerName),pServerInfo->szServerName,_TRUNCATE);
it->cGAMEINDEX = pServerInfo->cGAMEINDEX;
it->sIndex = (int) pServerInfo->dwIndex; //have to change the Buddy index to a new var that can hold bigger numbers such as DWORD
HWND hwndLV = g_hwndListBuddy;
LV_FINDINFO lvfi;
char szText[250];
memset(&lvfi,0,sizeof(LV_FINDINFO));
lvfi.flags = LVFI_PARAM;
lvfi.lParam = (LPARAM)pBI->dwID;
int index = ListView_FindItem(hwndLV , -1, &lvfi);
if(index!=-1)
{
LVITEM item;
item.mask = LVIF_TEXT | LVIF_IMAGE;
item.iItem = index;
memset(szText,0,sizeof(szText));
if(gm.GamesInfo[it->cGAMEINDEX].colorfilter!=NULL)
{
gm.GamesInfo[it->cGAMEINDEX].colorfilter(it->szServerName,szText,249);
item.pszText = szText;
item.cchTextMax = (int)strlen(szText);
}
else
{
item.pszText = it->szServerName;
item.cchTextMax = (int)strlen(it->szServerName);
}
item.iSubItem = 1;
item.iImage = gm.Get_GameIcon(it->cGAMEINDEX);
ListView_SetItem(g_hwndListBuddy,&item);
sprintf_s(szText,"%s:%d",pServerInfo->szIPaddress,pServerInfo->usPort);
strcpy_s(it->szIPaddress,szText);
ListView_SetItemText(g_hwndListBuddy,index ,2,szText);
}
if(gm.GamesInfo[it->cGAMEINDEX].colorfilter!=NULL)
gm.GamesInfo[it->cGAMEINDEX].colorfilter(it->szServerName,szText,249);
else
strcpy_s(szText,it->szPlayerName);
if(g_bRunningQueryServerList && g_bPlayedNotify==false)
PlayNotifySound(0 );
if(AppCFG.bBuddyNotify)
ShowBalloonTip("A buddy is online!",szText);
}
示例2: UpdateList
void CBuddyManager::UpdateList()
{
ListView_DeleteAllItems(g_hwndListBuddy);
LVITEM item;
ZeroMemory(&item, sizeof(LVITEM));
item.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM ;
int n=0;
for(unsigned int i=0; i<BuddyList.size(); i++)
{
BUDDY_INFO BI = BuddyList.at(i);
if(BI.bRemove == false)
{
char cf[MAX_NAME_LEN];
ZeroMemory(&item, sizeof(LVITEM));
item.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM ;
item.iSubItem = 0;
item.iImage = 3;
item.iItem = n;
if(gm.GamesInfo[BI.cGAMEINDEX].colorfilter!=NULL)
{
gm.GamesInfo[BI.cGAMEINDEX].colorfilter(BI.szPlayerName,cf,99);
item.pszText = cf;
item.cchTextMax = (int)strlen(cf);
}
else
{
item.pszText = BI.szPlayerName;
item.cchTextMax = (int)strlen(BI.szPlayerName);
}
item.lParam = (LPARAM)BI.dwID;
ListView_InsertItem( g_hwndListBuddy,&item);
//BUG!!
if(strlen(BI.szServerName)>0)
{
ZeroMemory(&item, sizeof(LVITEM));
item.mask = LVIF_IMAGE | LVIF_TEXT;
gm.GamesInfo[BI.cGAMEINDEX].colorfilter(BI.szServerName,cf,sizeof(cf)-2);
//ListView_SetItemText(g_hwndListBuddy,item.iItem ,1,cf);
item.iItem = n;
item.iSubItem = 1;
item.pszText = cf;
item.cchTextMax = (int)strlen(cf);
item.iImage = gm.Get_GameIcon(BI.cGAMEINDEX);
ListView_SetItem(g_hwndListBuddy,&item);
ListView_SetItemText(g_hwndListBuddy,item.iItem ,2,BI.szIPaddress);
}
n++;
}
}
ListView_SetColumnWidth(g_hwndListBuddy,0,LVSCW_AUTOSIZE);
ListView_SetColumnWidth(g_hwndListBuddy,1,100);
ListView_SetColumnWidth(g_hwndListBuddy,2,LVSCW_AUTOSIZE);
}