tooltip message handling nightmare abated

I recently spent a boggling amount of time — a couple of weeks, on and off — second-guessing Microsoft's tooltips message handling code. Not only does it have at least one nasty bug, but it seems designed to make easy cases easy, which is a diplomatic way of saying it tends to make anything beyond that very difficult. Do try it, and see if it works for you, but if you spend more than a day scratching your head and trying to overcome limitations, my recommendation is to skip TTM_RELAYEVENT, turn off all tool flags other than TTF_TRACK and TTF_ABSOLUTE, and get real cozy with TTM_TRACKACTIVATE and TTM_TRACKPOSITION. Oh, and write your own equivalent of TTF_SUBCLASS. Once I realized I ought to give this approach a try, I was out of the woods in just a couple days, and I've written some C++ classes which will relieve me from ever having to deal with this madness again.

No comments: