以下未经说明,listctrl默认view 风格为report

相关类及处理函数

MFC:CListCtrl类

SDK:以 “ListView_”开头的一些宏。如 ListView_InsertColumn


1. CListCtrl 风格

LVS_ICON: 为每个item显示大图标

    LVS_SMALLICON: 为每个item显示小图标

  LVS_LIST: 显示一列带有小图标的item

  LVS_REPORT: 显示item详细资料

直观的理解:windows资源管理器,“查看”标签下的“大图标,小图标,列表,详细资料”


2. 设置listctrl 风格及扩展风格

LONG lStyle;

  lStyle = GetWindowLong(m_list.m_hWnd, GWL_STYLE);//获取当前窗口style

  lStyle &= ~LVS_TYPEMASK; //清除显示方式位

  lStyle |= LVS_REPORT; //设置style

  SetWindowLong(m_list.m_hWnd, GWL_STYLE, lStyle);//设置style

  DWORD dwStyle = m_list.GetExtendedStyle();

  dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与report风格的listctrl)

  dwStyle |= LVS_EX_GRIDLINES;//网格线(只适用与report风格的listctrl)

  dwStyle |= LVS_EX_CHECKBOXES;//item前生成checkbox控件

  m_list.SetExtendedStyle(dwStyle); //设置扩展风格

  注:listview的style请查阅msdn       http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceshellui5/html/wce50lrflistviewstyles.asp


3. 插入数据

m_list.InsertColumn( 0, "ID", LVCFMT_LEFT, 40 );//插入列

  m_list.InsertColumn( 1, "NAME", LVCFMT_LEFT, 50 );

  int nRow = m_list.InsertItem(0, “11”);//插入行

  m_list.SetItemText(nRow, 1, “jacky”);//设置数据


4. 一直选中item

选中style中的Show selection always,或者在上面第2点中设置LVS_SHOWSELALWAYS


5. 选中和取消选中一行

int nIndex = 0;
    //选中
    m_list.SetItemState(nIndex, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
    //取消选中
    m_list.SetItemState(nIndex, 0, LVIS_SELECTED|LVIS_FOCUSED);


6. 得到listctrl中所有行的checkbox的状态

m_list.SetExtendedStyle(LVS_EX_CHECKBOXES);
      CString str;
      for(int i=0; i<m_list.GetItemCount(); i++)
      {
           if( m_list.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_list.GetCheck(i))
           {
                str.Format(_T("第%d行的checkbox为选中状态"), i);
                AfxMessageBox(str);
           }
      }


7. 得到listctrl中所有选中行的序号

方法一:
      CString str;
      for(int i=0; i<m_list.GetItemCount(); i++)
      {
           if( m_list.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED )
           {
                str.Format(_T("选中了第%d行"), i);
                AfxMessageBox(str);
           }
      }

方法二:
      POSITION pos = m_list.GetFirstSelectedItemPosition();
      if (pos == NULL)
           TRACE0("No items were selected!\n");
      else
      {
           while (pos)
           {
                int nItem = m_list.GetNextSelectedItem(pos);
                TRACE1("Item %d was selected!\n", nItem);
                // you could do your own processing on nItem here
           }
      }


8. 得到item的信息

TCHAR szBuf[1024];
      LVITEM lvi;
      lvi.iItem = nItemIndex;
      lvi.iSubItem = 0;
      lvi.mask = LVIF_TEXT;
      lvi.pszText = szBuf;
      lvi.cchTextMax = 1024;
      m_list.GetItem(&lvi);

关于得到设置item的状态,还可以参考msdn文章
      Q173242: Use Masks to Set/Get Item States in CListCtrl
       http://support.microsoft.com/kb/173242/en-us


9. 得到listctrl的所有列的header字符串内容

LVCOLUMN lvcol;
      char  str[256];
      int   nColNum;
      CString  strColumnName[4];//假如有4列

nColNum = 0;
      lvcol.mask = LVCF_TEXT;
      lvcol.pszText = str;
      lvcol.cchTextMax = 256;
      while(m_list.GetColumn(nColNum, &lvcol))
      { 
           strColumnName[nColNum] = lvcol.pszText;
           nColNum++;
      }


10. 使listctrl中一项可见,即滚动滚动条

m_list.EnsureVisible(i, FALSE);


11. 得到listctrl列数

int nHeadNum = m_list.GetHeaderCtrl()->GetItemCount();


12. 删除所有列

方法一:
         while ( m_list.DeleteColumn (0))
       因为你删除了第一列后,后面的列会依次向上移动。

方法二:
      int nColumns = 4;
      for (int i=nColumns-1; i>=0; i--)
          m_list.DeleteColumn (i);


13. 得到单击的listctrl的行列号

添加listctrl控件的NM_CLICK消息相应函数
      void CTest6Dlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           // 方法一:
           /*
           DWORD dwPos = GetMessagePos();
           CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
   
           m_list.ScreenToClient(&point);
   
           LVHITTESTINFO lvinfo;
           lvinfo.pt = point;
           lvinfo.flags = LVHT_ABOVE;
     
           int nItem = m_list.SubItemHitTest(&lvinfo);
           if(nItem != -1)
           {
                CString strtemp;
                strtemp.Format("单击的是第%d行第%d列", lvinfo.iItem, lvinfo.iSubItem);
                AfxMessageBox(strtemp);
           }
          */
   
          // 方法二:
          /*
           NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
           if(pNMListView->iItem != -1)
           {
                CString strtemp;
                strtemp.Format("单击的是第%d行第%d列",
                                pNMListView->iItem, pNMListView->iSubItem);
                AfxMessageBox(strtemp);
           }
          */
           *pResult = 0;
      }


14. 判断是否点击在listctrl的checkbox上

添加listctrl控件的NM_CLICK消息相应函数
      void CTest6Dlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           DWORD dwPos = GetMessagePos();
           CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
   
           m_list.ScreenToClient(&point);
   
           LVHITTESTINFO lvinfo;
           lvinfo.pt = point;
           lvinfo.flags = LVHT_ABOVE;
     
           UINT nFlag;
           int nItem = m_list.HitTest(point, &nFlag);
           //判断是否点在checkbox上
           if(nFlag == LVHT_ONITEMSTATEICON)
           {
                AfxMessageBox("点在listctrl的checkbox上");
           } 
           *pResult = 0;
      }


15. 右键点击listctrl的item弹出菜单

添加listctrl控件的NM_RCLICK消息相应函数
      void CTest6Dlg::OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
           if(pNMListView->iItem != -1)
           {
                DWORD dwPos = GetMessagePos();
                CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
    
                CMenu menu;
                VERIFY( menu.LoadMenu( IDR_MENU1 ) );
                CMenu* popup = menu.GetSubMenu(0);
                ASSERT( popup != NULL );
                popup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this );
           } 
           *pResult = 0;
  }


16. item切换焦点时(包括用键盘和鼠标切换item时),状态的一些变化顺序

添加listctrl控件的LVN_ITEMCHANGED消息相应函数
      void CTest6Dlg::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
           // TODO: Add your control notification handler code here
    
           CString sTemp;
  
           if((pNMListView->uOldState & LVIS_FOCUSED) == LVIS_FOCUSED && 
            (pNMListView->uNewState & LVIS_FOCUSED) == 0)
           {
                sTemp.Format("%d losted focus",pNMListView->iItem);
           }
           else if((pNMListView->uOldState & LVIS_FOCUSED) == 0 &&
               (pNMListView->uNewState & LVIS_FOCUSED) == LVIS_FOCUSED)
           {
                sTemp.Format("%d got focus",pNMListView->iItem);
           } 
  
           if((pNMListView->uOldState & LVIS_SELECTED) == LVIS_SELECTED &&
            (pNMListView->uNewState & LVIS_SELECTED) == 0)
           {
                sTemp.Format("%d losted selected",pNMListView->iItem);
           }
           else if((pNMListView->uOldState & LVIS_SELECTED) == 0 &&
            (pNMListView->uNewState & LVIS_SELECTED) == LVIS_SELECTED)
           {
                sTemp.Format("%d got selected",pNMListView->iItem);
           }
    
           *pResult = 0;
      }


17. 得到另一个进程里的listctrl控件的item内容

http://www.codeproject.com/threads/int64_memsteal.asp


18. 选中listview中的item

Q131284: How To Select a Listview Item Programmatically
http://support.microsoft.com/kb/131284/en-us


19. 如何在CListView中使用CListCtrl的派生类

http://www.codeguru.com/cpp/controls/listview/introduction/article.php/c919/


20. listctrl的subitem添加图标

m_list.SetExtendedStyle(LVS_EX_SUBITEMIMAGES);
      m_list.SetItem(..); //具体参数请参考msdn


21. 在CListCtrl显示文件,并根据文件类型来显示图标

网上找到的代码,share
      BOOL CTest6Dlg::OnInitDialog()
      {
           CDialog::OnInitDialog();
   
           HIMAGELIST himlSmall;
           HIMAGELIST himlLarge;
           SHFILEINFO sfi;
           char  cSysDir[MAX_PATH];
           CString  strBuf;
  
           memset(cSysDir, 0, MAX_PATH);
   
           GetWindowsDirectory(cSysDir, MAX_PATH);
           strBuf = cSysDir;
           sprintf(cSysDir, "%s", strBuf.Left(strBuf.Find("\\")+1));
  
           himlSmall = (HIMAGELIST)SHGetFileInfo ((LPCSTR)cSysDir,  
                      0,  
                      &sfi, 
                      sizeof(SHFILEINFO),  
                      SHGFI_SYSICONINDEX | SHGFI_SMALLICON );
   
           himlLarge = (HIMAGELIST)SHGetFileInfo((LPCSTR)cSysDir,  
                      0,  
                      &sfi,  
                      sizeof(SHFILEINFO),  
                      SHGFI_SYSICONINDEX | SHGFI_LARGEICON);
   
           if (himlSmall && himlLarge)
           {
                ::SendMessage(m_list.m_hWnd, LVM_SETIMAGELIST,
                             (WPARAM)LVSIL_SMALL, (LPARAM)himlSmall);
                ::SendMessage(m_list.m_hWnd, LVM_SETIMAGELIST,
                             (WPARAM)LVSIL_NORMAL, (LPARAM)himlLarge);
           }
           return TRUE;  // return TRUE  unless you set the focus to a control
      }
  
      void CTest6Dlg::AddFiles(LPCTSTR lpszFileName, BOOL bAddToDocument)
      {
           int nIcon = GetIconIndex(lpszFileName, FALSE, FALSE);
           CString strSize;
           CFileFind filefind;
  
           //  get file size
           if (filefind.FindFile(lpszFileName))
           {
                filefind.FindNextFile();
                strSize.Format("%d", filefind.GetLength());
           }
           else
                strSize = "0";
   
           // split path and filename
           CString strFileName = lpszFileName;
           CString strPath;
  
           int nPos = strFileName.ReverseFind('\\');
           if (nPos != -1)
           {
                strPath = strFileName.Left(nPos);
                strFileName = strFileName.Mid(nPos + 1);
           }
   
           // insert to list
           int nItem = m_list.GetItemCount();
           m_list.InsertItem(nItem, strFileName, nIcon);
           m_list.SetItemText(nItem, 1, strSize);
           m_list.SetItemText(nItem, 2, strFileName.Right(3));
           m_list.SetItemText(nItem, 3, strPath);
      }
  
      int CTest6Dlg::GetIconIndex(LPCTSTR lpszPath, BOOL bIsDir, BOOL bSelected)
      {
           SHFILEINFO sfi;
           memset(&sfi, 0, sizeof(sfi));
   
           if (bIsDir)
           {
            SHGetFileInfo(lpszPath,  
                         FILE_ATTRIBUTE_DIRECTORY,  
                         &sfi,  
                         sizeof(sfi),  
                         SHGFI_SMALLICON | SHGFI_SYSICONINDEX |
                         SHGFI_USEFILEATTRIBUTES |(bSelected ? SHGFI_OPENICON : 0));  
            return  sfi.iIcon;
           }
           else
           {
            SHGetFileInfo (lpszPath,  
                         FILE_ATTRIBUTE_NORMAL,  
                         &sfi,  
                         sizeof(sfi),  
                         SHGFI_SMALLICON | SHGFI_SYSICONINDEX |  
                         SHGFI_USEFILEATTRIBUTES | (bSelected ? SHGFI_OPENICON : 0));
            return   sfi.iIcon;
           }
           return  -1;
      }


22. listctrl内容进行大数据量更新时,避免闪烁

m_list.SetRedraw(FALSE);
      //更新内容
      m_list.SetRedraw(TRUE);
      m_list.Invalidate();
      m_list.UpdateWindow();
  
或者参考

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cwnd.3a3a.setredraw.asp


23. listctrl排序

Q250614:How To Sort Items in a CListCtrl in Report View
http://support.microsoft.com/kb/250614/en-us


24. 在listctrl中选中某个item时动态改变其icon或bitmap

Q141834: How to change the icon or the bitmap of a CListCtrl item in Visual C++
http://support.microsoft.com/kb/141834/en-us

How to change the icon or the bitmap of a

CListCtrl item in Visual C++

Article ID : 141834
Last Review : June 2, 2005
Revision : 3.0
This article was previously published under Q141834
NOTE: Microsoft Visual C++ NET (2002) supported both the managed code model that is provided by the .NET Framework and the unmanaged native Windows code model. The information in this article applies to unmanaged Visual C++ code only.

T>

SUMMARY

This article shows how to change the icon or bitmap of a CListCtrl item when it is selected.

MORE INFORMATION

When you initialize the CListCtrl by calling CListCtrl::InsertItem(), you can pass in a value of I_IMAGECALLBACK for the index of the image. This means that the system expects you to fill in the image index when you get an LVN_GETDISPINFO notification. Inside of the handler for LVN_GETDISPINFO, you can check if the item is selected and set the appropriate image index.

Sample Code

   BEGIN_MESSAGE_MAP(CTestView, CView)
//{{AFX_MSG_MAP(CTestView)
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_NOTIFY (LVN_GETDISPINFO, IDI_LIST, OnGetDispInfo)
END_MESSAGE_MAP() int CTestView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1; // m_pImage is a CTestView's member variable of type CImageList*
// create the CImageList with 16x15 images
m_pImage = new CImageList();
VERIFY (m_pImage->Create (16, 15, TRUE, 0, 1));
CBitmap bm;
// IDR_MAINFRAME is the toolbar bitmap in a default AppWizard
// project.
bm.LoadBitmap (IDR_MAINFRAME);
// This will automatically parse the bitmap into nine images.
m_pImage->Add (&bm, RGB (192, 192, 192)); // m_pList is CTestView's member variable of type CListCtrl*
// create the CListCtrl.
m_pList = new CListCtrl();
VERIFY (m_pList->Create (WS_VISIBLE | WS_CHILD | LVS_REPORT |
LVS_EDITLABELS, CRect (0, 0, 400, 400), this, IDI_LIST));
// Create column.
m_pList->InsertColumn (0, "Button Number", LVCFMT_LEFT, 100);
// Associate CImageList with CListCtrl.
m_pList->SetImageList (m_pImage, LVSIL_SMALL); char szTemp[10];
for (int iCntr = 0; iCntr < 9; iCntr++)
{
wsprintf (szTemp, "%d", iCntr);
m_pList->InsertItem (LVIF_IMAGE | LVIF_TEXT,
iCntr, szTemp, 0, 0, I_IMAGECALLBACK, 0L);
}
return 0;
} void CTestView::OnGetDispInfo (NMHDR* pnmhdr, LRESULT* pResult)
{
LV_DISPINFO* pdi = (LV_DISPINFO *) pnmhdr; // Fill in the LV_ITEM structure with the image info.
// When an item is selected, the image is set to the first
// image (the new bitmap on the toolbar).
// When it is not selected, the image index is equal to the
// item number (that is, 0=new, 1=open, 2=save, and so on.)
if (LVIS_SELECTED == m_pList->GetItemState (pdi->item.iItem,
LVIS_SELECTED))
pdi->item.iImage = 0;
else
pdi->item.iImage = pdi->item.iItem;
} CTestView::~CTestView()
{
// Clean up.
delete m_pImage;
delete m_pList;
}

25. 在添加item后,再InsertColumn()后导致整列数据移动的问题

Q151897: CListCtrl::InsertColumn() Causes Column Data to Shift 
http://support.microsoft.com/kb/151897/en-us


26. 关于listctrl第一列始终居左的问题

解决办法:把第一列当一个虚列,从第二列开始插入列及数据,最后删除第一列。
      
具体解释参阅   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/structures/lvcolumn.asp


27. 锁定column header的拖动

http://msdn.microsoft.com/msdnmag/issues/03/06/CQA/


28. 如何隐藏clistctrl的列

把需隐藏的列的宽度设为0,然后检测当该列为隐藏列时,用上面第27点的锁定column 的拖动来实现


29. listctrl进行大数据量操作时,使用virtual list

http://www.microsoft.com/msj/archive/S2061.aspx
http://www.codeguru.com/cpp/controls/listview/advanced/article.php/c4151/
http://www.codeproject.com/listctrl/virtuallist.asp


30. 关于item只能显示259个字符的问题

解决办法:需要在item上放一个edit。


31. 响应在listctrl的column header上的鼠标右键单击

Q125694: How To Find Out Which Listview Column Was Right-Clicked
http://support.microsoft.com/kb/125694/en-us


32. 类似于windows资源管理器的listview

Q234310: How to implement a ListView control that is similar to Windows Explorer by using DirLV.exe
http://support.microsoft.com/kb/234310/en-us


33. 在ListCtrl中OnTimer只响应两次的问题

Q200054:
PRB: OnTimer() Is Not Called Repeatedly for a List Control
http://support.microsoft.com/kb/200054/en-us


34. 以下为一些为实现各种自定义功能的listctrl派生类

(1)    拖放        
                   http://www.codeproject.com/listctrl/dragtest.asp

在CListCtrl和CTreeCtrl间拖放
                   http://support.microsoft.com/kb/148738/en-us
  
          (2)    多功能listctrl
                   支持subitem可编辑,图标,radiobutton,checkbox,字符串改变颜色的类
                   http://www.codeproject.com/listctrl/quicklist.asp
  
                   支持排序,subitem可编辑,subitem图标,subitem改变颜色的类
                   http://www.codeproject.com/listctrl/ReportControl.asp

(3)    subitem中显示超链接
                   http://www.codeproject.com/listctrl/CListCtrlLink.asp

(4)    subitem的tooltip提示
                   http://www.codeproject.com/listctrl/ctooltiplistctrl.asp

(5)    subitem中显示进度条    
                   http://www.codeproject.com/listctrl/ProgressListControl.asp
                   http://www.codeproject.com/listctrl/napster.asp
                   http://www.codeguru.com/Cpp/controls/listview/article.php/c4187/

(6)    动态改变subitem的颜色和背景色
                    http://www.codeproject.com/listctrl/highlightlistctrl.asp
                    http://www.codeguru.com/Cpp/controls/listbox/colorlistboxes/article.php/c4757/
 
          (7)    类vb属性对话框
                    http://www.codeproject.com/listctrl/propertylistctrl.asp
                    http://www.codeguru.com/Cpp/controls/listview/propertylists/article.php/c995/ 
                    http://www.codeguru.com/Cpp/controls/listview/propertylists/article.php/c1041/ 
  
          (8)    选中subitem(只高亮选中的item)
                    http://www.codeproject.com/listctrl/SubItemSel.asp
                    http://www.codeproject.com/listctrl/ListSubItSel.asp
  
          (9)    改变行高
                    http://www.codeproject.com/listctrl/changerowheight.asp
  
          (10)   改变行颜色
                    http://www.codeproject.com/listctrl/coloredlistctrl.asp
  
          (11)   可编辑subitem的listctrl
                    http://www.codeproject.com/listctrl/nirs2000.asp
                    http://www.codeproject.com/listctrl/editing_subitems_in_listcontrol.asp
  
          (12)   subitem可编辑,插入combobox,改变行颜色,subitem的tooltip提示
                    http://www.codeproject.com/listctrl/reusablelistcontrol.asp
  
          (13)   header 中允许多行字符串
                    http://www.codeproject.com/listctrl/headerctrlex.asp
  
          (14)   插入combobox
                    http://www.codeguru.com/Cpp/controls/listview/editingitemsandsubitem/article.php/c979/
  
          (15)   添加背景图片
                    http://www.codeguru.com/Cpp/controls/listview/backgroundcolorandimage/article.php/c4173/
                    http://www.codeguru.com/Cpp/controls/listview/backgroundcolorandimage/article.php/c983/
                    http://www.vchelp.net/vchelp/archive.asp?type_id=9&class_id=1&cata_id=1&article_id=1088&search_term=
    
          (16)  自适应宽度的listctrl
                    http://www.codeproject.com/useritems/AutosizeListCtrl.asp

(17)  改变ListCtrl高亮时的颜色(默认为蓝色)
                   处理 NM_CUSTOMDRAW 
           http://www.codeproject.com/listctrl/lvcustomdraw.asp

     (18)  改变header颜色
          http://www.pocketpcdn.com/articles/hdr_color.html

原文地址:http://blog.csdn.net/lixiaosan/article/details/653563

【转】MFC CListCtrl 使用技巧的更多相关文章

  1. MFC CListCtrl 将一个列表的选中项添加到另一个列表

    MFC CListCtrl 将一个列表的选中项添加到另一个列表, 用VC6.0实现: 简单记录一下自己的学习历程, 和大家分享,如果对你有用,我很高兴. 1.新建一个基于对话框的工程(Dialog-B ...

  2. [MFC] 梳理一个简单的图片处理桌面软件中用到的MFC控件技巧

     前言 前些天应好友之拖,帮忙设计一个简单的图像处理的小软件.朋友把核心算法封装好了,但是是用openCV类似于console的编程环境,要我在此基础上改成MFC桌面程序.下图是做成之后的效果: 我是 ...

  3. (转)C++ CListCtrl使用技巧的摘抄

    转:http://blog.csdn.net/sanshao27/article/details/1888315 1. CListCtrl 风格 LVS_ICON: 为每个item显示大图标      ...

  4. 【VS开发】MFC CListCtrl列表控件的消息响应

    MFC里的CListCtrl选中一行,消息是哪个.实在想不起来了.找了一篇文章,比较有用: http://www.cnblogs.com/hongfei/archive/2012/12/25/2832 ...

  5. MFC编程小技巧——强制杀死进程

    在某些应用场合下,我们可能需要在启动A进程启动时关闭进程B.MFC下该如何做呢?以下是我项目中用到的代码: int KillProcess(DWORD Pid) { //打开进程得到进程句柄 HAND ...

  6. MFC调试小技巧

    今天看acl源码的时候看到一个函数AllocConsole().百度一下感觉这个函数对于调试非常不错,当然对于MFC里面的调试信息,我都是用TRACE打印自己感兴趣的消息的,而且仅仅有在DEBUG里面 ...

  7. mfc CListCtrl 报表格式

    知识点: CListCtrl报表格式 CListCtrl报表格式添加列 CListCtrl报表格式添加行 CListCtrl报表格式设置单元格 一.CListCtrl报表格式 类名:SysListVi ...

  8. mfc CListCtrl

    了解CListCtrl属性 了解CListCtrl常用成员函数 代码示例 一.CListCtrl常用属性 View:视图方式;.大(标准)图标2.小图标3.列表4.报表 Sort:排序; No Scr ...

  9. MFC CListCtrl得到ctrl,shift多选的行号

    vector<int> selVect; int count = m_consumeList.GetItemCount(); //你的列表多少行 for (int i = 0; i< ...

随机推荐

  1. Linux进程学习 - 孤儿进程和守护进程

    孤儿进程和守护进程 通过前面的学习我们了解了如何通过fork()函数和vfork()函数来创建一个进程.现在 我们继续深入来学习两个特殊的进程:孤儿进程和守护进程 一.孤儿进程 1.什么是 孤儿进程如 ...

  2. CView类的使用

    首先我们来写一个样例: 1.建一个win32简单应用程序,不要觉得这样就不能写出MFC程序,由于是不是MFC程序取决于调没调MFC函数. 2. 删除入口函数.仅仅留下#include "st ...

  3. 问题解决:在此页上的ActiveX控件

    打开什么美图秀秀就会弹出windows安全警告?网易闪电邮每打开一封邮件就会出现安全警告?这个对话框无论你点是否,都会再次出现!! 网上的方法教你改ie设置 教你改UAC 通通不好用!!!重装系统也不 ...

  4. cv1.0入门

    作者 群号 C语言交流中心 环境 VS2010UltimTrial1.iso                    http://pan.baidu.com/s/1dEL85kl VS2010Ulti ...

  5. [hihoCoder] #1093 : 最短路径·三:SPFA算法

    时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 万圣节的晚上,小Hi和小Ho在吃过晚饭之后,来到了一个巨大的鬼屋! 鬼屋中一共有N个地点,分别编号为1..N,这N个地点之 ...

  6. cocos2d-x开发记录:二,基本概念(粒子系统,Scheduler和定时器)

    七,粒子系统 1.导言 术语粒子系统是指计算机图形学技术,它使用大量非常小的精灵或其他图形对象来模拟某些种类的“模糊”现象,于传统渲染技术相比,它很难复制.通常是高度混沌无序的系统,自然现象.化学反应 ...

  7. Mingw opencv Windows下命令行运行

    1.下载opencv 2.3 http://sourceforge.net/projects/opencvlibrary/files/ 下个opencv-win版本吧 至于版本号就随意吧,我选的是2. ...

  8. 恶意程序入侵 dbuspm-session 发现了新的方法制这种恶意程序

    直接从一台没服务器上把这两文件scp到当前的服务器上并替换这两个程序就ok了!!!!这种方法测试成功!!!! 出现了一个比效麻烦的事,服务器的负载正常,内存也正常,但就是很卡. 通过查找到线索:htt ...

  9. UBuntu14.04下安装和卸载Qt5.3.1

    安装: 1. Qt5.3.1下载地址为:http://qt-project.org/,选择”Qt 5.3.1 for Linux 32-bit”版本,文件名是”qt-opensource-linux- ...

  10. filebeat+kafka+SparkStreaming程序报错及解决办法

    // :: WARN RandomBlockReplicationPolicy: Expecting replicas with only peer/s. // :: WARN BlockManage ...