How to receive mouse coordinates (of client) in CTreeCtrl? - Programmer

This is a discussion on How to receive mouse coordinates (of client) in CTreeCtrl? - Programmer ; Hi all, I'd like to do some operations after user selects/deselects a checkbox of CTreeCtrl item. So I override NM_CLICK message of CTreeCtrl and use HitTest method, but I need client coordinates of the point to test. GetCursorPos retrieves the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to receive mouse coordinates (of client) in CTreeCtrl?

  1. How to receive mouse coordinates (of client) in CTreeCtrl?

    Hi all,

    I'd like to do some operations after user selects/deselects a checkbox of
    CTreeCtrl item.
    So I override NM_CLICK message of CTreeCtrl and use HitTest method, but I
    need client coordinates of the point to test.
    GetCursorPos retrieves the global coordinates.
    Please help.

    Deli


  2. Re: How to receive mouse coordinates (of client) in CTreeCtrl?


    "Deli" schrieb im Newsbeitrag
    news:ce48po$on2$1@news.onet.pl...
    > Hi all,
    >
    > I'd like to do some operations after user selects/deselects a checkbox of
    > CTreeCtrl item.
    > So I override NM_CLICK message of CTreeCtrl and use HitTest method, but I
    > need client coordinates of the point to test.
    > GetCursorPos retrieves the global coordinates.
    > Please help.
    >
    > Deli
    >

    Hello,

    POINT pt;
    ::GetCursorPos(&pt);
    GetDlgItem(IDC_TREE)->ScreenToClient(&pt);

    Hope it helps.
    Roland



+ Reply to Thread