user1544067
user1544067

Reputation: 1764

Does a window receive triple click events? How can I handle higher-order clicks?

Does a window receive a message about triple-clicks, like it does for double-clicks? I can't find a WM_LBUTTONTRIPLECLICK message that works like the WM_LBUTTONDBLCLK message.

I want to implement something similar to Microsoft Word, where a triple-click selects the entire paragraph. How can I detect a triple-click on my window?

Upvotes: 3

Views: 1245

Answers (1)

Mike Kwan
Mike Kwan

Reputation: 24477

This is documented on MSDN: http://msdn.microsoft.com/en-us/magazine/cc163628.aspx

The idea is to wait for a double-click and then check for a click within a certain time period after that.

It's not just Internet Explorer, it's also Microsoft Word and Outlook®, though Outlook is slightly different in that triple-click selects lines instead of paragraphs. You're right, there's no WM_LBUTTONTRIPLECLICK, but it's not hard to implement one yourself. After all, what's a triple click but three clicks in rapid succession? Or a double-click and single-click in rapid succession. All you have to know is how quickly do the clicks have to arrive to count as a triple-click? To find out, you can call the appropriately named ::GetDoubleClickTime, which returns the double-click time in milliseconds. So if you get a double-click and then a single-click within this many milliseconds, it counts as a triple-click.

Upvotes: 8

Related Questions