本文整理汇总了C++中pfc::list_t::remove_item方法的典型用法代码示例。如果您正苦于以下问题:C++ list_t::remove_item方法的具体用法?C++ list_t::remove_item怎么用?C++ list_t::remove_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pfc::list_t
的用法示例。
在下文中一共展示了list_t::remove_item方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_message
LRESULT console_window::on_message(HWND wnd,UINT msg,WPARAM wp,LPARAM lp)
{
switch(msg)
{
case WM_CREATE:
{
/**
* Store a pointer to ourselve in this list, used for global notifications (in the main thread)
* which updates instances of our panel.
*/
list_wnd.add_item(this);
{
insync(sync);
/** Store a window handle in this list, used in global notifications (in any thread) which
* updates the panels */
g_notify_list.add_item(wnd);
}
long flags = 0;
if (cfg_frame == 1) flags |= WS_EX_CLIENTEDGE;
else if (cfg_frame == 2) flags |= WS_EX_STATICEDGE;
/** Create our edit window */
wnd_edit = CreateWindowEx(flags, WC_EDIT, _T(""),
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOVSCROLL | WS_VSCROLL | ES_READONLY | ES_MULTILINE, 0, 0, 0, 0,
wnd, HMENU(IDC_EDIT), core_api::get_my_instance(), NULL);
if (wnd_edit)
{
if (g_font)
{
/** Nth, n>1, instance; use exisiting font handle */
SendMessage(wnd_edit,WM_SETFONT,(WPARAM)g_font,MAKELPARAM(0,0));
}
else
/** First window - create the font handle */
g_update_all_fonts();
/** Store a pointer to ourself in the user data field of the edit window */
SetWindowLongPtr(wnd_edit,GWL_USERDATA,(LPARAM)(this));
/** Subclass the edit window */
m_editproc = (WNDPROC)SetWindowLongPtr(wnd_edit,GWL_WNDPROC,(LPARAM)(hook_proc));
SendMessage(wnd, MSG_UPDATE, 0, 0);
}
}
break;
/** Update the edit window's text */
case MSG_UPDATE:
{
insync(sync);
pfc::string8_fastalloc buffer;
buffer.prealloc(1024);
unsigned n, count = g_messages.get_count();
for (n=0; n<count; n++)
{
buffer << "[" << pfc::format_int(g_messages[n].m_time.wHour, 2)
<< ":" << pfc::format_int(g_messages[n].m_time.wMinute, 2)
<< ":" << pfc::format_int(g_messages[n].m_time.wSecond, 2)
<< "] " << g_messages[n].m_message;
#if 0
buffer.add_string(pfc::string_printf("[%02u:%02u:%02u] ",(unsigned)g_messages[n].m_time.wHour
,(unsigned)g_messages[n].m_time.wMinute
,(unsigned)g_messages[n].m_time.wSecond));
buffer.add_string(g_messages[n].m_message);
//if (n != count-1)
// buffer.add_string("\r\n",2);
#endif
}
uSetWindowText(wnd_edit, buffer);
LONG_PTR len = SendMessage(wnd_edit, EM_GETLINECOUNT , 0, 0);
SendMessage(wnd_edit, EM_LINESCROLL , 0, len);
}
break;
case WM_GETMINMAXINFO:
break;
case WM_SIZE:
/** Reposition the edit window. */
SetWindowPos(wnd_edit, 0, 0, 0, LOWORD(lp), HIWORD(lp), SWP_NOZORDER);
break;
case WM_ERASEBKGND:
return FALSE;
case WM_DESTROY:
{
wnd_edit=0;
list_wnd.remove_item(this);
SendMessage(wnd_edit,WM_SETFONT,NULL,MAKELPARAM(0,0));
if (list_wnd.get_count() == 0)
{
DeleteFont(g_font);
g_font = 0;
}
{
insync(sync);
g_notify_list.remove_item(wnd);
}
}
break;
}
//.........这里部分代码省略.........