Microsoft KB Archive/153382

{|
 * width="100%"|

How to Add Middle Mouse Button from a VxD Using Simple Hook

 * }

Q153382

-

The information in this article applies to:


 * Microsoft Win32 Device Driver Kit (DDK) Windows 95

-

SUMMARY
A VxD can hook the VMD_Manipulate_Pointer_Message call using Hook_Device_Service to modify mouse information sent in messages. But if you just want to cause a middle button status during message updates, you can hook a similar but simpler VMD_Set_Middle_Button call.

MORE INFORMATION
Note that the sample code at the top of the Mouse.hlp help file page is not for you to write; it is there to give you an idea of what VMOUSE does internally. The language of the help screen is from the standpoint of VMOUSE. "Returns" a value should read "YOU return" a value, and so on. As you might suspect, the address you are hooking contains only a RET instruction. VMD_Set_Middle_Button is called with BL=current status, which you do NOT modify, and BH=0x00, which you can:


 * "OR" as VMOUSE does to build status.

-or-
 * "MOV" and set to 0x40 for button down.

-or-
 * Leave alone (for speed).

-or-
 * Set to 0x00 (for robustness) for button up.