MSCURSOR


MSCURSOR ( 3.1), . , .

3.1. mscursor\mscursor.c

// =====================================================

//

//

// (C) ., 1997

//

// E-mail: frolov@glas.apc.org

// WWW: http://www.glasnet.ru/~frolov

//

// http://www.dials.ccas.ru/frolov

// =====================================================

#include <dos.h>

#include <stdio.h>

#include <conio.h>

int main(void)

{

int nButtons;

union REGS rg;

printf("MSCURSOR, (c) A. Frolov, 1997\n");

//

rg.x.ax = 0;

int86(0x33, &rg, &rg);

if(rg.x.bx == 0)

{

printf("Mouse not found");

return -1;

}

//

nButtons = rg.x.bx;

printf("Mouse type: ");

switch (nButtons)

{

case 2:

{

printf("2-button mouse\n");

break;

}

case 3:

{

printf("2-button Mouse Systems\n");

break;

}

case 0:

{

printf("Unknown type %d\n", nButtons);

break;

}

default:

{

printf("Unknown type %d\n", nButtons);

break;

}

}

// ,

//

rg.x.ax = 1;

int86(0x33, &rg, &rg);

printf("Mouse cursor on. Press any key\n");

getch();

//

rg.x.ax = 2;

int86(0x33, &rg, &rg);

printf("Mouse cursor off. Press any key\n");

getch();

return 0;

}