Function 38: Get Maximum Virtual Coordinates

Last reviewed: September 16, 1996
Article ID: Q75952
The information in this article applies to:
  • Microsoft Mouse Driver for MS-DOS, versions 6.x, 7.x, 8.x, and 9.0

SUMMARY

The code example below demonstrates the use of mouse function 38. For additional information, refer to the "Microsoft Mouse Programmer's Reference Guide."

MORE INFORMATION

Mouse function 38 returns whether the mouse is enabled, and returns the virtual X and Y maximum coordinates.

Note: If the mouse driver version is earlier than version 7.05, function 38 returns the current set virtual X & Y maximum (in current mode). For driver versions 7.05 and later, function 38 returns the absolute virtual X & Y maximum (in current mode).

   Input          Output
   -----          ------

   AX = 38        BX = Mouse disabled flag
                       0 if mouse is enabled
                       !0 if mouse is disabled
                  CX = Virtual X maximum (in current video mode)
                  DX = Virtual Y maximum (in current video mode)

// This is an example of mouse function 38.
// Function 38: Get Maximum Virtual Coordinates

#include <stdio.h>
#include <stdlib.h>

#define v626  0x0626
#define v705  0x0705

unsigned int  bxr,cxr,dxr, dvr;

char *mdf, *vmm;


void main( void )
{

/* check driver version */
 _asm
    {
    mov ax,36
    int 33h
    mov dvr,bx   ;save results
    }

if ( dvr < v626)
      {
printf("function 38 requires driver 6.26 or greater \n"); exit(0);
      }

/* function 38 */
 _asm
    {
    mov ax,38
    int 33h
    mov bxr,bx    ;save results
    mov cxr,cx
    mov dxr,dx
    }

printf("Function 38 Returned Values \n");
printf("   Value in BX is %Xh \n",bxr);
printf("   Value in CX is %Xh \n",cxr);
printf("   Value in DX is %Xh \n\n",dxr);

if (!bxr) mdf= "ENABLED"; else mdf= "DISABLED"; printf("MOUSE DISABLED FLAG.\n");
printf("   mouse driver %s\n\n",mdf);

printf("MOUSE MAXIMUMS\n");
printf("   {Note: if driver version is prior 7.05 this returns \n");
printf("    current set virtual X & Y max (in current mode) \n");
printf("    for driver version 7.05 and higher this returns\n");
printf("    Absolute virtual X & Y max (in current mode)} \n\n");

if (dvr < v705) vmm= "CURRENTLY SET"; else vmm = "ACTUAL";
printf("   %s virtual X max :>>%d<< (for current mode)\n",vmm,cxr);
printf("   %s virtual Y max :>>%d<< (for current mode)\n",vmm,dxr);

printf("\n\n"); }


KBCategory: kbhw kbprg
KBSubcategory:

Additional reference words: 8.00 8.10 8.20 9.00


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: September 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.