本文整理汇总了C++中OBJLIST类的典型用法代码示例。如果您正苦于以下问题:C++ OBJLIST类的具体用法?C++ OBJLIST怎么用?C++ OBJLIST使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OBJLIST类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: fclose
MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr, const TCHAR *ptszFile, unsigned options)
{
if (ptszFile == NULL)
return NULL;
Logger *result = new Logger(pszName, ptszDescr, ptszFile, options);
if (result == NULL)
return NULL;
int idx = arLoggers.getIndex(result);
if (idx != -1) {
delete result;
return &arLoggers[idx];
}
FILE *fp = _tfopen(ptszFile, _T("ab"));
if (fp == NULL) {
TCHAR tszPath[MAX_PATH];
_tcsncpy_s(tszPath, ptszFile, _TRUNCATE);
CreatePathToFileT(tszPath);
}
else fclose(fp);
DeleteFile(ptszFile);
arLoggers.insert(result);
return result;
}
示例4: 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;
}
示例5: 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);
}
示例6: 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);
}
}
示例7: 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;
}
示例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: getContactCache
CContactCache* CContactCache::getContactCache(HANDLE hContact)
{
CContactCache *cc = arContacts.find((CContactCache*)&hContact);
if (cc == NULL) {
cc = new CContactCache(hContact);
arContacts.insert(cc);
}
return cc;
}
示例11: xpt_FreeThemeForWindow
void xpt_FreeThemeForWindow(HWND hwnd)
{
mir_cslock lck(xptCS);
auto T = xptObjectList.rev_iter();
for (auto &xptObject : T)
if (xptObject->hOwnerWindow == hwnd) {
_sttXptCloseThemeData(xptObject);
xptObjectList.remove(T.indexOf(&xptObject));
}
}
示例12: 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);
}
}
示例13: xpt_FreeThemeHandle
void xpt_FreeThemeHandle(XPTHANDLE xptHandle)
{
mir_cslock lck(xptCS);
if (xpt_IsValidHandle(xptHandle)) {
XPTObject* xptObject = (XPTObject*)xptHandle;
_sttXptCloseThemeData(xptObject);
mir_free(xptHandle);
xptObjectList.remove(xptObjectList.indexOf(xptObject));
}
}
示例14: KillChatTimer
void CIrcProto::KillChatTimer(UINT_PTR &nIDEvent)
{
if ( nIDEvent ) {
EnterCriticalSection( &timers_cs );
TimerPair temp( this, nIDEvent );
int idx = timers.getIndex( &temp );
if ( idx != -1 )
timers.remove( idx );
LeaveCriticalSection( &timers_cs );
KillTimer(NULL, nIDEvent);
nIDEvent = NULL;
} }
示例15: xpt_IsValidHandle
BOOL xpt_IsValidHandle(XPTHANDLE xptHandle)
{
if (!xptHandle) return FALSE;
mir_cslock lck(xptCS);
return xptObjectList.indexOf((XPTObject*)xptHandle) != -1;
}