Click here to Skip to main content
15,905,229 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVisual C++ wizard Pin
De Nardis Andrea7-Feb-03 5:03
De Nardis Andrea7-Feb-03 5:03 
Questionhow to set CListbox row height variable? Pin
hamchoy7-Feb-03 4:52
hamchoy7-Feb-03 4:52 
AnswerRe: how to set CListbox row height variable? Pin
Roger Allen7-Feb-03 6:07
Roger Allen7-Feb-03 6:07 
GeneralCPen Pin
Ahmad997-Feb-03 3:55
Ahmad997-Feb-03 3:55 
GeneralRe: CPen Pin
Joaquín M López Muñoz7-Feb-03 4:00
Joaquín M López Muñoz7-Feb-03 4:00 
GeneralRe: CPen Pin
Ahmad997-Feb-03 4:09
Ahmad997-Feb-03 4:09 
GeneralRe: CPen Pin
Maximilien7-Feb-03 4:19
Maximilien7-Feb-03 4:19 
GeneralCTreeCtrl Pin
will13837-Feb-03 3:51
will13837-Feb-03 3:51 
Hi all,

I'm trying to implement an explorer type tree view that allows traversing of the drives. My problem is I'm trying to take into account if a removable drive, cdrom, etc. If theres nothing in the drive, then I want to move the selected item back to the previous one. Problem is, when trying to sift through msdn, it isn't clear how to change the states of the items (at least to me). Here's what I'm trying to do (in general):

NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*) pNMHDR;
CString strPath = GetPathFromItem (pNMTreeView->itemNew.hItem);
...
if ((hFind = ::FindFirstFile (strPath, &fd)) == INVALID_HANDLE_VALUE) {
CString temp = strPath + _T("is not accessible\n\nThe Device is not ready\n");
CString temp2 = _T("Exploring ") + strPath;
MessageBox(temp,temp2 ,MB_OK | MB_ICONERROR);
pNMTreeView->SetItemState(pNMTreeView->itemNew.hItem,TVIS_SELECTED,
pNMTreeView->SetItemState(m_prevSelection, // Then what?
} else {
this->m_prevSelection = pNMTreeView->itemNew.hItem;
}

You can see where I am confused, when setting the item states. Am I doing this correctly? What do I need to do in order to properly change the items selected.

Any help in the matter it greatly appreciated. thanks alot!

Dan Willis
GeneralRe: CTreeCtrl Pin
Joaquín M López Muñoz7-Feb-03 3:59
Joaquín M López Muñoz7-Feb-03 3:59 
GeneralRe: CTreeCtrl Pin
will13837-Feb-03 4:11
will13837-Feb-03 4:11 
GeneralRe: CTreeCtrl Pin
Joaquín M López Muñoz7-Feb-03 4:33
Joaquín M López Muñoz7-Feb-03 4:33 
GeneralRe: CTreeCtrl Pin
will13837-Feb-03 4:36
will13837-Feb-03 4:36 
GeneralRe: CTreeCtrl Pin
Joaquín M López Muñoz7-Feb-03 4:43
Joaquín M López Muñoz7-Feb-03 4:43 
GeneralRe: CTreeCtrl Pin
will13837-Feb-03 4:50
will13837-Feb-03 4:50 
GeneralRe: CTreeCtrl Pin
will13837-Feb-03 5:31
will13837-Feb-03 5:31 
GeneralRe: CTreeCtrl Pin
will13837-Feb-03 5:44
will13837-Feb-03 5:44 
GeneralCapturing stdout/stderr Pin
Chou7-Feb-03 3:40
Chou7-Feb-03 3:40 
GeneralRe: Capturing stdout/stderr Pin
Joaquín M López Muñoz7-Feb-03 3:43
Joaquín M López Muñoz7-Feb-03 3:43 
GeneralRe: Capturing stdout/stderr Pin
Chou7-Feb-03 3:51
Chou7-Feb-03 3:51 
GeneralConverting C++ project to MFC Pin
Jabir7-Feb-03 3:29
Jabir7-Feb-03 3:29 
GeneralRe: Converting C++ project to MFC Pin
Joaquín M López Muñoz7-Feb-03 3:45
Joaquín M López Muñoz7-Feb-03 3:45 
GeneralRe: Converting C++ project to MFC Pin
Jabir7-Feb-03 21:42
Jabir7-Feb-03 21:42 
GeneralVisio like MFC control Pin
loic7-Feb-03 2:57
loic7-Feb-03 2:57 
GeneralLibrary in Visual C++ .NET Pin
jongentje7-Feb-03 2:40
jongentje7-Feb-03 2:40 
GeneralRe: Library in Visual C++ .NET Pin
HENDRIK R7-Feb-03 2:49
HENDRIK R7-Feb-03 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.