本文整理汇总了C++中OBJLIST::getCount方法的典型用法代码示例。如果您正苦于以下问题:C++ OBJLIST::getCount方法的具体用法?C++ OBJLIST::getCount怎么用?C++ OBJLIST::getCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBJLIST
的用法示例。
在下文中一共展示了OBJLIST::getCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NudgeSend
INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam)
{
char *protoName = GetContactProto(hContact);
int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
TCHAR msg[500];
mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
CNudgeElement &p = arNudges[i];
if (!mir_strcmp(protoName, p.ProtocolName))
Nudge_ShowPopup(&p, hContact, msg);
}
}
else Nudge_ShowPopup(&DefaultNudge, hContact, msg);
return 0;
}
db_set_dw(hContact, "Nudge", "LastSent", time(NULL));
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
CNudgeElement &p = arNudges[i];
if (!mir_strcmp(protoName, p.ProtocolName))
if (p.showStatus)
Nudge_SentStatus(&p, hContact);
}
}
else if (DefaultNudge.showStatus)
Nudge_SentStatus(&DefaultNudge, hContact);
CallProtoService(protoName, PS_SEND_NUDGE, hContact, lParam);
return 0;
}
示例2: Layout
void CJabberDlgDataPage::Layout()
{
RECT rc; GetClientRect(m_hwnd, &rc);
int w = rc.right - 20;
int x = 10;
int y = 10;
m_height = rc.bottom;
m_scrollPos = GetScrollPos(m_hwnd, SB_VERT);
HDWP hdwp = BeginDeferWindowPos(m_controls.getCount());
for (int i = 0; i < m_controls.getCount(); ++i)
if (int h = m_controls[i].Layout(hdwp, x, y - m_scrollPos, w))
y += h + 5;
EndDeferWindowPos(hdwp);
m_dataHeight = y + 5;
SCROLLINFO si = {0};
si.cbSize = sizeof(si);
si.fMask = SIF_DISABLENOSCROLL|SIF_PAGE|SIF_RANGE;
si.nPage = m_height;
si.nMin = 0;
si.nMax = m_dataHeight;
SetScrollInfo(m_hwnd, SB_VERT, &si, TRUE);
}
示例3: APCWndProc
LRESULT CALLBACK APCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_NULL:
while (APCCallQueue.getCount())
{
APCCall tmpCall;
WaitForSingleObject(hApcMutex, INFINITE);
if (APCCallQueue.getCount())
{
tmpCall = APCCallQueue[0];
APCCallQueue.remove(0);
}
ReleaseMutex(hApcMutex);
if (tmpCall.func) tmpCall.func(tmpCall.param);
}
SleepEx(0, TRUE); // process APCs created by plugins that do not use core service
break;
case WM_TIMECHANGE:
RecalculateTime();
break;
}
return DefWindowProc(hwnd,msg,wParam,lParam);
}
示例4: SmileyDownloadThread
void __cdecl SmileyDownloadThread(void*)
{
bool needext = false;
HANDLE hHttpDwnl = NULL;
WaitForSingleObject(g_hDlMutex, 3000);
while (!Miranda_Terminated() && dlQueue.getCount()) {
ReleaseMutex(g_hDlMutex);
if (_taccess(dlQueue[0].fname.c_str(), 0) != 0) {
InternetDownloadFile(T2A_SM(dlQueue[0].url.c_str()), T2A_SM(dlQueue[0].fname.c_str()), hHttpDwnl);
WaitForSingleObject(g_hDlMutex, 3000);
CMString fname(dlQueue[0].fname);
if (dlQueue[0].needext) { fname += GetImageExt(fname); needext = true; }
_trename(dlQueue[0].fname.c_str(), fname.c_str());
}
else WaitForSingleObject(g_hDlMutex, 3000);
dlQueue.remove(0);
}
dlQueue.destroy();
if (hHttpDwnl) Netlib_CloseHandle(hHttpDwnl);
threadRunning = false;
ReleaseMutex(g_hDlMutex);
if (!Miranda_Terminated()) {
if (needext)
CallServiceSync(MS_SMILEYADD_RELOAD, 0, 0);
else
NotifyEventHooks(hEvent1, 0, 0);
}
}
示例5: RecalculateTime
void RecalculateTime(void)
{
GetTimeZoneInformation(&myInfo.myTZ.tzi);
myInfo.timestamp = time(NULL);
myInfo.myTZ.offset = INT_MIN;
bool found = false;
DYNAMIC_TIME_ZONE_INFORMATION dtzi;
if (pfnGetDynamicTimeZoneInformation && pfnGetDynamicTimeZoneInformation(&dtzi) != TIME_ZONE_ID_INVALID) {
TCHAR *myTzKey = mir_u2t(dtzi.TimeZoneKeyName);
_tcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE);
mir_free(myTzKey);
found = true;
}
for (int i = 0; i < g_timezones.getCount(); i++) {
MIM_TIMEZONE &tz = g_timezones[i];
if (tz.offset != INT_MIN)
tz.offset = INT_MIN;
if (!found) {
if (!mir_wstrcmp(tz.tzi.StandardName, myInfo.myTZ.tzi.StandardName) || !mir_wstrcmp(tz.tzi.DaylightName, myInfo.myTZ.tzi.DaylightName)) {
_tcsncpy_s(myInfo.myTZ.tszName, tz.tszName, _TRUNCATE);
found = true;
}
}
}
}
示例6: getCacheItem
// преобразует mode в HICON который НЕ НУЖНО разрушать в конце
static ICON_CACHE& getCacheItem(int mode, int type)
{
int m = mode & 0x0f, s = (mode & SECURED)>>4, i; // разобрали на части - режим и состояние
HICON icon;
for (i=0; i < arIcoList.getCount(); i++)
if (arIcoList[i].mode == ((type<<8) | mode))
return arIcoList[i];
i = s;
switch(type) {
case 1: i += IEC_CL_DIS; break;
case 2: i += ICO_CM_DIS; break;
case 3: i += ICO_MW_DIS; break;
}
if (type == 1)
icon = BindOverlayIcon(g_hIEC[i], g_hICO[ICO_OV_NAT+m]);
else
icon = BindOverlayIcon(g_hICO[i], g_hICO[ICO_OV_NAT+m]);
ICON_CACHE *p = new ICON_CACHE;
p->icon = icon;
p->mode = (type << 8) | mode;
p->hCLIcon = NULL;
arIcoList.insert(p);
return *p;
}
示例7: VoiceUnregister
static INT_PTR VoiceUnregister(WPARAM wParam, LPARAM lParam)
{
char *moduleName = (char *) wParam;
if (moduleName == NULL || moduleName[0] == 0)
return -1;
VoiceProvider *module = FindModule(moduleName);
if (module == NULL)
return -2;
for(int i = calls.getCount() - 1; i >= 0; --i)
{
VoiceCall *call = &calls[i];
if (call->module == module)
{
call->Drop();
call->SetState(VOICE_STATE_ENDED);
calls.remove(i);
}
}
modules.remove(module);
if (hwnd_frame != NULL)
PostMessage(hwnd_frame, WMU_REFRESH, 0, 0);
return 0;
}
示例8: RemoveProtoIconIndex
static void RemoveProtoIconIndex(PROTOACCOUNT *pa)
{
for (int i = 0; i < protoIconIndex.getCount(); i++)
if (mir_strcmp(protoIconIndex[i].szProto, pa->szModuleName) == 0) {
protoIconIndex.remove(i);
break;
}
}
示例9: RemoveVoiceCall
static void RemoveVoiceCall(const char *szModule, const char *id)
{
for(int i = calls.getCount() - 1; i >= 0; --i)
{
if (IsCall(&calls[i], szModule, id))
calls.remove(i);
}
}
示例10: FindModule
VoiceProvider * FindModule(const char *szModule)
{
for(int i = 0; i < modules.getCount(); i++)
if (strcmp(modules[i].name, szModule) == 0)
return &modules[i];
return NULL;
}
示例11: AddMethodsFrom
static void AddMethodsFrom(OBJLIST<CallingMethod> *list, HANDLE hContact, const TCHAR *number)
{
for(int i = 0; i < modules.getCount(); i++)
{
VoiceProvider *provider = &modules[i];
if (provider->CanCall(number))
list->insert(new CallingMethod(provider, hContact, number));
}
}
示例12: xpt_OnWM_THEMECHANGED
void xpt_OnWM_THEMECHANGED()
{
xptlock();
{
for (int i=0; i < xptObjectList.getCount(); i++)
_sttXptReloadThemeData(&xptObjectList[i]);
}
xptunlock();
}
示例13: RefreshContactListIcons
void RefreshContactListIcons(void)
{
for (int i=0; i < arIcoList.getCount(); i++)
arIcoList[i].hCLIcon = 0;
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if (isSecureProtocol(hContact))
ShowStatusIcon(hContact);
}
示例14: QueueRemove
static void QueueRemove(MCONTACT hContact)
{
mir_cslock lck(cs);
for (int i = queue.getCount() - 1; i >= 0; i--) {
QueueItem& item = queue[i];
if (item.hContact == hContact)
queue.remove(i);
}
}
示例15: CanCall
bool CanCall(HANDLE hContact, BOOL now)
{
for(int i = 0; i < modules.getCount(); i++)
{
if (modules[i].CanCall(hContact, now))
return true;
}
return false;
}