Click here to Skip to main content
15,903,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to know programatically that Windows has logged in/Logged Off/Shut Down occured etc? Pin
David Crow20-Jan-06 8:08
David Crow20-Jan-06 8:08 
QuestionAccessing dialogue from global function Pin
Anu_Bala20-Jan-06 1:40
Anu_Bala20-Jan-06 1:40 
AnswerRe: Accessing dialogue from global function Pin
Cedric Moonen20-Jan-06 1:50
Cedric Moonen20-Jan-06 1:50 
AnswerRe: Accessing dialogue from global function Pin
Rage20-Jan-06 3:19
professionalRage20-Jan-06 3:19 
AnswerRe: Accessing dialogue from global function Pin
fat_boy20-Jan-06 4:22
fat_boy20-Jan-06 4:22 
QuestionProblems printing with GDI+ Pin
Alberto_Canabal20-Jan-06 1:27
Alberto_Canabal20-Jan-06 1:27 
QuestionHow to recursively check the check boxes in CTreeCtrl? Pin
Vairamuthu. G.20-Jan-06 1:25
Vairamuthu. G.20-Jan-06 1:25 
AnswerRe: How to recursively check the check boxes in CTreeCtrl? Pin
Stephen Hewitt20-Jan-06 3:10
Stephen Hewitt20-Jan-06 3:10 
Try something like this:
------------------------

void CTreeDlg::TickSubtree(HTREEITEM hRootItem)
{
// Tick the root item.
m_Tree.SetCheck(hRootItem);

// Now do the entire subtree depth first.
HTREEITEM hItem = m_Tree.GetChildItem(hRootItem);
while ( hItem!=NULL )
{
// Tick the item.
m_Tree.SetCheck(hItem);

// Move to the first child.
HTREEITEM hNextItem = m_Tree.GetChildItem(hItem);

// No child? If not try the next sibling.
if ( hNextItem==NULL )
{
hNextItem = m_Tree.GetNextSiblingItem(hItem);

// No more siblings? Try the nearest next sibling of an ancestor.
if ( hNextItem==NULL )
{
do
{
hItem = m_Tree.GetParentItem(hItem);

// We're done if we reach the root.
if ( hItem==hRootItem || hItem == NULL )
{
return;
}

hNextItem = m_Tree.GetNextSiblingItem(hItem);
}
while (hNextItem==NULL);
}
}

hItem = hNextItem;
}
}

void CTreeDlg::OnButton1()
{
// Populate tree.
HTREEITEM h1 = m_Tree.InsertItem(_T("1"));
HTREEITEM h2 = m_Tree.InsertItem(_T("1-1"), h1);
HTREEITEM h3 = m_Tree.InsertItem(_T("1-2"), h1);
HTREEITEM h4 = m_Tree.InsertItem(_T("1-2-1"), h3);
HTREEITEM h5 = m_Tree.InsertItem(_T("1-2-1-1"), h4);
HTREEITEM h6 = m_Tree.InsertItem(_T("1-2-1-2"), h4);
HTREEITEM h7 = m_Tree.InsertItem(_T("1-2-2"), h3);
HTREEITEM h8 = m_Tree.InsertItem(_T("1-2-2-1"), h7);
HTREEITEM h9 = m_Tree.InsertItem(_T("1-2-2-2"), h7);
HTREEITEM h10 = m_Tree.InsertItem(_T("1-2-3"), h3);
HTREEITEM h11 = m_Tree.InsertItem(_T("1-2-3-1"), h10);
HTREEITEM h12 = m_Tree.InsertItem(_T("1-2-3-2"), h10);
HTREEITEM h13 = m_Tree.InsertItem(_T("1-2-4"), h3);
HTREEITEM h14 = m_Tree.InsertItem(_T("1-2-4-1"), h13);
HTREEITEM h15 = m_Tree.InsertItem(_T("1-2-4-2"), h13);
HTREEITEM h16 = m_Tree.InsertItem(_T("1-3"), h1);
HTREEITEM h17 = m_Tree.InsertItem(_T("1-4"), h1);

// Tick h3 and all its children.
TickSubtree(h3);
}


Steve
GeneralRe: How to recursively check the check boxes in CTreeCtrl? Pin
Vairamuthu. G.20-Jan-06 4:23
Vairamuthu. G.20-Jan-06 4:23 
GeneralRe: How to recursively check the check boxes in CTreeCtrl? Pin
Stephen Hewitt20-Jan-06 4:36
Stephen Hewitt20-Jan-06 4:36 
AnswerRe: How to recursively check the check boxes in CTreeCtrl? Pin
Rage20-Jan-06 3:15
professionalRage20-Jan-06 3:15 
GeneralRe: How to recursively check the check boxes in CTreeCtrl? Pin
Stephen Hewitt20-Jan-06 3:22
Stephen Hewitt20-Jan-06 3:22 
GeneralRe: How to recursively check the check boxes in CTreeCtrl? Pin
Rage20-Jan-06 4:24
professionalRage20-Jan-06 4:24 
QuestionGet IP address of computer Pin
waxie20-Jan-06 0:52
waxie20-Jan-06 0:52 
AnswerRe: Get IP address of computer Pin
Laxman920-Jan-06 17:44
Laxman920-Jan-06 17:44 
GeneralRe: Get IP address of computer Pin
Owner drawn22-Jan-06 17:16
Owner drawn22-Jan-06 17:16 
GeneralRe: Get IP address of computer Pin
waxie22-Jan-06 17:33
waxie22-Jan-06 17:33 
GeneralRe: Get IP address of computer Pin
Owner drawn22-Jan-06 17:36
Owner drawn22-Jan-06 17:36 
GeneralRe: Get IP address of computer Pin
waxie22-Jan-06 18:15
waxie22-Jan-06 18:15 
GeneralRe: Get IP address of computer Pin
Owner drawn22-Jan-06 18:22
Owner drawn22-Jan-06 18:22 
GeneralRe: Get IP address of computer Pin
waxie22-Jan-06 18:30
waxie22-Jan-06 18:30 
GeneralRe: Get IP address of computer Pin
waxie22-Jan-06 18:40
waxie22-Jan-06 18:40 
GeneralRe: Get IP address of computer Pin
Owner drawn22-Jan-06 18:44
Owner drawn22-Jan-06 18:44 
GeneralRe: Get IP address of computer Pin
waxie22-Jan-06 18:52
waxie22-Jan-06 18:52 
GeneralRe: Get IP address of computer Pin
Owner drawn22-Jan-06 18:57
Owner drawn22-Jan-06 18:57 

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.