6.6. Windows Common Controls (a.k.a. Windows 95 controls)

6.6.1. Can I use these controls under NT or Win32s?

Windows NT 3.50 does not support the common controls, and will not in the future. You must use Windows NT version 3.51 to gain the common controls.

blaszczak@BIX.com, mfc-l, 7/6/95

Version 1.30 of Win32s supports the Common controls.

6.6.2. Where's a demo of these wickedly cool controls?

Check out the MFC sample, fire, it features most of the controls in action: MSVC20\samples\mfc\fire. Under 4.0, there's another one called cmnctrls.

scot@stingray.com, 7/27/95

6.6.3. How do you handle NM_DBLCLK for a CListCtl?

BEGIN_MESSAGE_MAP(CListView, CView)
    ON_NOTIFY( NM_DBLCLK,ID_LISTCTRL,OnDblClick )
END_MESSAGE_MAP()
void CListView::OnDblClick(NMHDR* /*k*/, LRESULT* /*j*/)
{
    int nItem, nFlags;
    char szTest[80];
    nFlags = LVNI_SELECTED;
    nItem = m_ListCtrl->GetNextItem(-1, nFlags );
    if ( nItem != -1 )
    {
        sprintf( szTest, "Selected Item %d", nItem);
        AfxMessageBox(szTest);
    }
}

spolyak@interaccess.com, mfc-l, 7/21/95

6.6.4. Does CTreeCtrl support multiple selection?

No. Sorry! (I see this one all the time!)

scot@stingray.com

If it's accessible to you, Microsoft Systems Journal, July 1994, has an extensive look at TreeViews, including a sample program that includes drag & drop. If you're developing for Windows 95, you don't need a shareware implementation, MFC has a class for it.

steven@primenet.com

6.6.5. When I expand a node in my CTreeCtrl, there's no visual feedback, what to do?

Create the control with TVS_SHOWSELALWAYS style.

kfreeman@viewlogic.com

6.6.6. (The FAQ of the devil!) How do I implement multiple selection, tooltips, editable nodes and multiple columns in my tree control?

Unfortunately, since the tree control lives in a binary DLL, it is not very extensible and you are stuck without these features. There have been articles on how to try and "hack" these features, but they do not work reliably.

We have a drop-in tree control replacement that implements all of these features and more in Objective Toolkit. Demos are at http://www.stingray.com.