Click here to Skip to main content
14,428,694 members

C / C++ / MFC

 
AnswerRe: Is there a conventional name for accessing e.g. memories with fewer address bits than required, using range a selector? Pin
leon de boer12-Aug-19 16:09
Memberleon de boer12-Aug-19 16:09 
AnswerRe: Is there a conventional name for accessing e.g. memories with fewer address bits than required, using range a selector? Pin
arnold_w12-Aug-19 23:43
Memberarnold_w12-Aug-19 23:43 
GeneralRe: Is there a conventional name for accessing e.g. memories with fewer address bits than required, using range a selector? Pin
Peter_in_278013-Aug-19 2:44
professionalPeter_in_278013-Aug-19 2:44 
GeneralRe: Is there a conventional name for accessing e.g. memories with fewer address bits than required, using range a selector? Pin
leon de boer13-Aug-19 6:55
Memberleon de boer13-Aug-19 6:55 
Questionamibroker afl to dll Pin
kuleen10-Aug-19 21:37
Memberkuleen10-Aug-19 21:37 
AnswerRe: amibroker afl to dll Pin
Victor Nijegorodov10-Aug-19 22:30
MemberVictor Nijegorodov10-Aug-19 22:30 
AnswerRe: amibroker afl to dll Pin
Richard MacCutchan10-Aug-19 23:37
communityengineerRichard MacCutchan10-Aug-19 23:37 
QuestionCTreeCtrl get individual item font ? Pin
Maximilien8-Aug-19 5:55
MemberMaximilien8-Aug-19 5:55 
I'm setting a CTreeCtrl item item font to Italic by handling the NM_CUSTOMDRAW message and setting the font with SelectObject.

This is working.
void MyTree::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
{
    NMTVCUSTOMDRAW *itemToDraw = reinterpret_cast<NMTVCUSTOMDRAW*>>(pNMHDR);

    switch (itemToDraw->nmcd.dwDrawStage)
    {
    case CDDS_PREPAINT:
        *pResult = CDRF_NOTIFYITEMDRAW;
        return;
    case CDDS_ITEMPREPAINT:
    {
        HTREEITEM item = reinterpret_cast<HTREEITEM>(itemToDraw->nmcd.dwItemSpec);

        if (!m_IsItalicFontCreated) //Create once the italic font
        {
            CFont* currentFont = GetFont();
            LOGFONT logfont;
            currentFont->GetLogFont(&logfont);
            logfont.lfItalic = TRUE;
            m_ItalicFont.CreateFontIndirect(&logfont);
            m_IsItalicFontCreated = true;
        }

        if (m_IsItalicFontCreated)
        {
            ::SelectObject(itemToDraw->nmcd.hdc, m_ItalicFont);
            *pResult = CDRF_NEWFONT;
        }
    }
    return;
    }

    *pResult = 0;
}

But at some point I need to check an item current font; to see if a tree item is in italic.

The CTreeCtrl's item data (CTreeCtrl::SetItemData) is already used to hold data for each item.

Is it possible to do it ? I can't see in the documentation anything I can use.

There is a lItemlParam in the NMCUSTOMDRAW struct, I'm not certain if I could use this to some some simple data ? or even if it is persistent.

Any suggestions ?
Thanks.
I'd rather be phishing!

AnswerRe: CTreeCtrl get individual item font ? Pin
Victor Nijegorodov8-Aug-19 10:40
MemberVictor Nijegorodov8-Aug-19 10:40 
GeneralRe: CTreeCtrl get individual item font ? Pin
Maximilien9-Aug-19 6:07
MemberMaximilien9-Aug-19 6:07 
AnswerMessage Closed Pin
9-Aug-19 1:53
MemberMember 145550709-Aug-19 1:53 
AnswerRe: CTreeCtrl get individual item font ? Pin
Victor Nijegorodov9-Aug-19 2:57
MemberVictor Nijegorodov9-Aug-19 2:57 
GeneralRe: CTreeCtrl get individual item font ? Pin
Maximilien9-Aug-19 6:07
MemberMaximilien9-Aug-19 6:07 
Questionerror C2143: syntax error Pin
_Flaviu8-Aug-19 1:22
Member_Flaviu8-Aug-19 1:22 
AnswerRe: error C2143: syntax error Pin
Daniel Pfeffer8-Aug-19 2:00
professionalDaniel Pfeffer8-Aug-19 2:00 
AnswerRe: error C2143: syntax error Pin
Stefan_Lang8-Aug-19 22:59
mveStefan_Lang8-Aug-19 22:59 
GeneralRe: error C2143: syntax error Pin
_Flaviu9-Aug-19 1:20
Member_Flaviu9-Aug-19 1:20 
Questionzero-sized array in struct/union Pin
_Flaviu5-Aug-19 22:39
Member_Flaviu5-Aug-19 22:39 
AnswerRe: zero-sized array in struct/union Pin
Victor Nijegorodov5-Aug-19 23:13
MemberVictor Nijegorodov5-Aug-19 23:13 
GeneralRe: zero-sized array in struct/union Pin
_Flaviu5-Aug-19 23:24
Member_Flaviu5-Aug-19 23:24 
GeneralRe: zero-sized array in struct/union Pin
Victor Nijegorodov5-Aug-19 23:28
MemberVictor Nijegorodov5-Aug-19 23:28 
GeneralRe: zero-sized array in struct/union Pin
Randor 5-Aug-19 23:31
professional Randor 5-Aug-19 23:31 
GeneralRe: zero-sized array in struct/union Pin
CPallini5-Aug-19 23:36
mveCPallini5-Aug-19 23:36 
JokeRe: zero-sized array in struct/union Pin
Randor 5-Aug-19 23:43
professional Randor 5-Aug-19 23:43 
GeneralRe: zero-sized array in struct/union Pin
CPallini6-Aug-19 0:02
mveCPallini6-Aug-19 0:02 

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.