15 Apr 2014



At the peak of the mountain... there's a hill?

This week really didn’t “start”; it was merely a continuation of the past weeks.

The issue where the toolbar did not receive clicks was one of those annoying problems where finding the apparent cause is easy, but finding a solution not so much. The issue, as far as I could tell, was related to using SetCapture as a means to track the mouse movement on top of the toolbar. If I disabled that piece of code, the clicks got through, but – of course – other features stopped working.

I messed around for a while, aimlessly, until I got a simple idea: wouldn’t the toolbar use the existing TrackMouseEvent feature as a means to decide when the mouse moves away from its rectangle? If so, it would mean the toolbar would receive a WM_MOUSELEAVE event, which I could use instead of the captures. Lucky for me, it worked!

There were some details to fix still, and I had to test that it worked in all the platforms, and in fact, some of those details still remain today, but the basic and essential mouse interactions as well as they can be expected to work.

Happy Cat

After this long-awaited success, I took a step back and decided to revise the code, comment some more functions, and test previously-working features known bugs, to see if anything changed. Of course, something had to fail, otherwise my work may be easy to do.

While testing, I noticed the context menus weren’t working correctly. I fixed it somewhat, but a very strange issue remains. When I right-click on certain items, I get the following exception:

First-chance exception at {address} in explorer.exe: 0xC0000008: An invalid handle was specified.

When this happens, the context menu doesn’t get to display, and the call to IContextMenu::QueryContextMenu() never returns. Breaking on the exception points to TortoiseGit being at fault, but it makes me wonder: is it a problem with TortoiseGit, or is it a side-effect of a bug in my code? Given that TGit works fine otherwise, and it worked in the past, I must assume it’s my fault. But I don’t know how to even begin testing this issue.

Hangover Cat


This blog post represents the personal opinion of the author and is not representative of the position of the ReactOS Project.