Free Source Code and Program Tips
Win32/MFC
MFC sample code, MFC projects
How to get ClistCtrl item text of another process
Sep 24th
Question: In some app like WinSpy/Spy++ to make adjustments to list controls. It can correctly set an app’s list control’s modes, alignments, sorting, styles, and extended styles. It can also get the widths of the columns and count of items. The problem is that you cannot seem to get the columns’ names or the item
30 Great Tips of CListCtrl Program(2)
Jun 3rd
30 Great Tips of CListCtrl Program(1) 8. Get Item Infomation 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); More infomation: Q173242: Use Masks to Set/Get Item States in CListCtrl 9. Get the header titile of CListCtrl LVCOLUMN lvcol;char str[256];int nColNum;CString strColumnName[MAX_COL];nColNum = 0;lvcol.mask = LVCF_TEXT;lvcol.pszText = str;lvcol.cchTextMax = 256;while(m_list.GetColumn(nColNum, &lvcol)){
30 Great Tips of CListCtrl Program(1)
Jun 3rd
Without a special note,the listctrl has the default view style of report. 1. CListCtrl style LVS_ICON: for each item displayed great icon LVS_SMALLICON: for each item displayed on the icon LVS_LIST: a show with a small icon on the item LVS_REPORT: Show item details You can inspect the Windows Explorer,
The Simplest way to change the row height of CListCtrl
Jan 14th
In the post “How to change the row height of CListCtrl“, it gives 2 solution example how to change row height or CListCtrl. Hower, it is not the simplest way. The simplest way to change the row height in a CListCtrl is: Display an icon with the desired height. All other ways that I know
How to hilight an item in CTreeCtrl/CTreeView
Oct 25th
How to hilight or bold an item in CTreeCtrl/CTreeView? There is no real difference between CTreeCtrl and CTreeView. You need to use an owner draw tree control. Takeover the NM_CUSTOMDRAW message, and it will allow you to change the font, brush, etc. of each individual item. You don’t need to do any owner draw if
How to subclass CTreeCtrl in CTreeView?
Oct 25th
Another title: How to use a derived CTreeCtrl in a CTreeView? It is similar with this article: “How to use an derived CListCtrl in CListView” or “How do I subclass the CListCtrl part of a CListView Class?“. Just like CListView, there is no CTreeCtrl to subclass in CTreeView. The CTreeView is the subclass of the
How do I subclass the CListCtrl part of a CListView Class?
Oct 22nd
Read this article: How to use an derived CListCtrl in CListView
How to sort items of CListCtrl or CListView?
Oct 22nd
How to sort the items of a CListCtrl or CListView(CReportView)? First, when you add items, you need to call SetItemData to attach an data structure(an integer or a pointer) to the item. Then, define a callback sort function. int CALLBACK SortFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); And here, the prarameters lParam1 and lParam2 are the
Link error when mix MBCS and Unicode in ONE project
Oct 18th
A Solution which contents 3 projects and below are the names & their character set encoding type 1. Utility – > MBCS 2. Calculations -> MBCS 3. User Interface -> Unicode ( Earlier It used to be MBCS) WhenChanged the Character set encoding for User Interface and compiled the code, you will get hte Errors