Problem while implementing tool tip in listctrl of report type.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Problem while implementing tool tip in listctrl of report type.

  1. #1
    Join Date
    Jul 2007
    Location
    Pune, INDIA
    Posts
    125

    Question Problem while implementing tool tip in listctrl of report type.

    Hi,
    Below is my Code Code snippet wher I am facing problem.

    every time "pNMHDR->idFrom" is returning 0.

    I even put "EnableToolTips(TRUE);" in the oninitdialog method of dialog class.

    BEGIN_MESSAGE_MAP(CMyListCtrl, ListCtrl)
    .
    .
    .
    ON_NOTIFY_EX(TTN_NEEDTEXTW, 0, OnToolTipText)
    ON_NOTIFY_EX(TTN_NEEDTEXTA, 0, OnToolTipText)
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()
    .
    .
    .
    .
    BOOL CMyListCtrl::OnToolTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
    {
    // need to handle both ANSI and UNICODE versions of the message
    TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
    TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
    CString strTipText;
    UINT nID = pNMHDR->idFrom;

    if( nID == 0 ) // Notification in NT from automatically
    return FALSE; // created tooltip

    int row = ((nID-1) >> 10) & 0x3fffff ;
    int col = (nID-1) & 0x3ff;
    strTipText = GetItemText( row, col );
    .
    .
    }

    Please let me know what wrong I am doing. I am not able to get the text of a listctrl cell.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,379

    Re: Problem while implementing tool tip in listctrl of report type.

    1. What ID do you expect to get?
    2. Did you try to use LVS_EX_INFOTIP ext. style and handle LVN_GETINFOTIP notification?
    3. Please, use Code tags while posting code snippets.
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2007
    Location
    Pune, INDIA
    Posts
    125

    Re: Problem while implementing tool tip in listctrl of report type.

    "Did you try to use LVS_EX_INFOTIP ext. style and handle LVN_GETINFOTIP notification"

    No I have not implemented these. can you please provide any sample code/link for using these.

    Thanks in Advance.

  4. #4
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,379

    Re: Problem while implementing tool tip in listctrl of report type.

    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center