Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Win32 C++ (non-MFC) application which uses a TreeView control. The control is created with the TVS_DISABLEDRAGDROP style not set. My expectation was that in this case I would receive a TVN_BEGINDRAG notification and could handle the drag operation from that handler. (Moreover, this used to work -- it has been part of released product code for several years and worked fine until recently. At some point, something changed.)

Now, I never receive a TVN_BEGINDRAG message. I am able to use a tree item as the source of a drag, but to do so, I need to detect the drag inside my mouse-down handler, instead of in the TVN_BEGINDRAG handler.

Can anyone explain why this might be the case? Although I have a work around in place, I would like to understand why this work-around is necessary.

Thank you.

Rick Aurbach
Aurbach & Associate, Inc.
Posted
Comments
Sergey Alexandrovich Kryukov 27-Jun-12 16:01pm    
Do you also handle mouse events properly? Please see:
http://support.microsoft.com/kb/214814
Yes, I understand your question...
--SA

1 solution

Sergey,

Thanks for your rapid response, but the solution shown in the support article doesn't help much. Since the notification never happens, there's the g_fdragging flag never gets set, so there's no way for the logic implemented in the other handlers to work.

I'm basically handling the other drag logic using the same methodology I use everywhere else in my program. (This tree view is only one of many different types of objects which can be either drag sources or targets or both.) My implementation of the appropriate handlers works a bit differently, but accomplishes the same purposes as the code from the support article.

This still leaves the question open -- why don't I get the notification??

Rick
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900