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

Last reviewed: July 10, 1996
Article ID: Q153382
The information in this article applies to:
  • Microsoft Windows Device Development Kit (DDK) for 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.

REFERENCES

Mouse.hlp from the DDK. VMOUSE internal source code.


Additional reference words:
KBCategory: kbprg kbhowto
KBSubcategory: DdkMouse



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 10, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.