Why not implementing IDropTarget (http://msdn.microsoft.com
Main Topics
Browse All TopicsHello, dear friend!
I'm using Borland C++.
I have a simple form to categorize my MP3s, with a TTreeView in it.
When I drag a file from *outside* my application into my TTreeView, then there are absolutle none events getting fired. In other words, 'ondragover', 'onmousemove' and so on does't work.
Of course I set "DragAcceptFiles(...)" and 'OnDragDrop' works. But I need to know if the mouse drag files *bevore* OnDragDrop is fired, I ned this information just when the mouse enters my application to do some graphical things.
Does anyone know, how to detect if the mouse is in "Drag-Mode" and
hold files when it enters my application?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Why not implementing IDropTarget (http://msdn.microsoft.com
>>>> Window receives WM_MOUSEMOVE when the mouse cursor is in it.
That is true only if mouse was captured. But I would assume it is still captured by the DragDrop operation and only one window can capture the mouse at one time.
Even if you could capture the mouse it is that you would need to get an initial trigger when the mouse was entering the application. As the mouse clicks were done outside they can't be the trigger. I would think the trick is to have your main application window be a DropTarget what probably is what (or similar to) jkr has suggested (I don't know enough from using COM and Borland, though).
Check your main window class if you can make it a drop target (same as the tree window) and if so, try to implement the DragEnter (see jkr's comment above) which seems to be the event you were searching for and should be available for all drag target capable windows.
Business Accounts
Answer for Membership
by: pgnatyukPosted on 2009-08-28 at 06:03:48ID: 25207122
Window receives WM_MOUSEMOVE when the mouse cursor is in it.
Here is an info about the mouse input:
http://msdn.microsof t.com/en-u s/library/ ms645533(V S.85).aspx
I don't know enough this drag and drop topic. Probably, if I'd need it, I'd use WM_MOUSEMOVE.
But, maybe, this info will help you:
DragDetect: http://msdn.microsoft.com/ en-us/libr ary/ms6462 56(VS.85). aspx
if (DragDetect(hWnd, pointCursorPos) ) do_something();
Here is an article about Drag and Drop: http://www.suodenjoki.dk/u s/producti ons/articl es/dragdro ptab.htm It looks not bad.