Cheers for the reply. I've done what you suggested, and it seems to be an improvement. However now it appears as though the WndProc isn't recieving all mouse messages.

When testing it out, the left and middle buttons function correctly when clicking them. However the right does not. When simply clicking the right mouse button, I recieve a mouse down message, but no mouse up message. But if I were to press the button down, move it, and then release it, I recieve the mouse up message. There are other situations with other combinations of keys which cause this behaviour --- the only way I recieve *every* mouse down and up message is when I move the mouse inbetween.

I've attempted to fix this by faking mouse movement by posting a WM_MOUSEMOVE message to the tree view when any mouse down/up message is recieved, as well as calling SetCursorPos with the current mouse coordinates, but neither of these methods work.

Any ideas?