views:

32

answers:

1

Many mice and keyboards have "zoom" buttons on them. These almost always generate Ctrl+Mouse Wheel messages to the applications, so they are easily accounted for by us programmers.

But my current Logitech mouse has an additional feature. The zoom wheel indeed sends Ctrl+Mouse Wheel messages when scrolled (or, actually, tilted), but when I depress the zoom wheel, most programs restore the zoom level to the default, i.e. 100 %. What kind of message does the mouse send to the application in this case? I cannot find a suitable virtual key code for it.

I should probably say that I have tried to capture this event. In my Delphi application, I wrote handlers for the KeyDown, MouseDown, and MouseWheel events, but non of them are triggered by this mysterious button.

Applications that support this button:

  • Google Chrome 5.0.375.127
  • Microsoft Word 2010

Applications that seem not to support this button:

  • Microsoft WordPad in Windows 7
  • Microsoft Paint in Windows 7
+1  A: 

There is no dedicated shortcut key-stroke or Windows message. Odds are pretty good that the mouse helper has specific awareness of the process that has the focus. And generates the specific command that this program needs to reset the zoom, possibly a WM_COMMAND message. Use a tool like Microsoft's Spy++ to see what messages are generated, if any.

Hans Passant