MSGFORM


MSGFORM, ( 3.3).

3.3. msgform\msgform.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>

#include <stdlib.h>

union REGS reg;

void ms_gform(int xt, int yt, char _far *form);

unsigned char form[64] =

{

// ""

255, 255, 255, 255, 255, 255, 255, 255, 255, 255,

255, 255, 255, 255, 255, 255,

255, 255, 255, 255, 255, 255, 255, 255, 255, 255,

255, 255, 255, 255, 255, 255,

// " "

127, 254, 127, 254, 127, 254, 127, 254, 127, 254,

127, 254, 127, 254, 0, 0,

0, 0, 127, 254, 127, 254, 127, 254, 127, 254, 127, 254,

127, 254, 127, 254

};

int main(void)

{

unsigned old_videomode, new_videomode;

char buf[20], *bufptr;

//

reg.x.ax = 0x0f00;

int86(0x10, &reg, &reg);

old_videomode = reg.h.al;

//

buf[0] = 10;

printf("Enter new video mode: ");

bufptr = cgets(buf);

new_videomode = atoi(bufptr);

reg.h.ah = 0;

reg.h.al = new_videomode;

int86(0x10, &reg, &reg);

//

reg.x.ax = 0;

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

if(reg.x.bx == 0)

{

printf("Mouse not found\n");

return -1;

}

//

ms_gform(0,0, &form[0]);

//

reg.x.ax = 1;

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

getch();

reg.h.ah = 0;

reg.h.al = old_videomode;

int86(0x10, &reg, &reg);

return 0;

}

void ms_gform(int xt, int yt, char _far *form)

{

struct SREGS segregs;

reg.x.ax = 9;

reg.x.bx = xt;

reg.x.cx = yt;

reg.x.dx = FP_OFF(form);

segregs.es = FP_SEG(form);

int86x(0x33,&reg,&reg,&segregs);

}