What I do is to try in GUI_Visualstudio7 samples 1. Re declare the m_wndResourceView as shelltree: // CTreeCtrl m_wndResourceView; CXTShellTreeCtrl m_wndResourceView; 2. Change the createResourceView in MainFrm.h CWnd* CMainFrame::CreateResourceView() { if (m_wndResourceView.GetSafeHwnd() == 0) { if (!m_wndResourceView.Create( WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_SHOWSELALWAYS, CRect(0,0,0,0), this, 0xFF )) { TRACE0( "Unable to create tree control.\n" ); return 0; } /* m_wndResourceView.ModifyStyleEx(0, WS_EX_STATICEDGE); // load the tree images bitmap and add it to the image list. if (!m_ilResourceView.Create(IDB_RESTREE, 16, 1, COLOR_MASK)) return 0;
// Set the image list for the tree control. m_wndResourceView.SetImageList( &m_ilResourceView, TVSIL_NORMAL );
// add the parent item HTREEITEM htItem = m_wndResourceView.InsertItem(_T("XtremeDemo resources"), 0, 1); m_wndResourceView.SetItemState(htItem, TVIS_BOLD, TVIS_BOLD);
HTREEITEM hti = m_wndResourceView.InsertItem(_T("Accelerator"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("IDR_MAINFRAME") , 2, 2, hti); m_wndResourceView.Expand(hti, TVE_EXPAND);
hti = m_wndResourceView.InsertItem(_T("Dialog"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("IDD_ABOUTBOX"), 3, 3, hti); m_wndResourceView.Expand(hti, TVE_EXPAND);
hti = m_wndResourceView.InsertItem(_T("Icon"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("IDR_MAINFRAME") , 4, 4, hti); m_wndResourceView.InsertItem(_T("IDR_XTREMETYPE" ), 4, 4, hti); m_wndResourceView.Expand(hti, TVE_EXPAND);
hti = m_wndResourceView.InsertItem(_T("Menu"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("IDR_MAINFRAME") , 5, 5, hti); m_wndResourceView.InsertItem(_T("IDR_XTREMETYPE" ), 5, 5, hti);
hti = m_wndResourceView.InsertItem(_T("String Table"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("String Table"), 6, 6, hti);
hti = m_wndResourceView.InsertItem(_T("Toolbar"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("IDR_MAINFRAME") , 7, 7, hti);
hti = m_wndResourceView.InsertItem(_T("Version"), 0, 1, htItem); m_wndResourceView.InsertItem(_T("VS_VERSION_INFO "), 8, 8, hti);
m_wndResourceView.Expand (htItem, TVE_EXPAND); */
} return &m_wndResourceView; }
3. Rebuilt GUI_visualStudio7 1. Run Gui_visualStudio and show Resource View rightclick one folder and show context menu
|