ID: Q75952
The information in this article applies to:
The code example below demonstrates the use of mouse function 38. For additional information, refer to the "Microsoft Mouse Programmer's Reference Guide."
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
Last Reviewed: September 16, 1996