I have a program that causes windows to snap into slots that specify a location and size. You can drag a window and then it will snap to the closest slot when you finish the drag. What I want to add is an overlay of the slot that the window will be moved to as the drag is happening.
The snapping and the overlay work fine. My problem is that I need a better way to know if the window is being dragged. The way I was preventing a window from snapping to slot while a drag was happening is by just not doing anything while the mouse was clicked. Drawing the overlay while the mouse is clicked works, but causes the overlay to show up anytime the mouse is clicked even if a window is being dragged.
Is there a method that will take a hwnd and tell me if that window is being dragged? Or is there a better way go about this process?