1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| #include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
#include<dos.h>
void graph()
{
int gdriver=DETECT , gmode, errorcode;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
}
void souris()
{
_AX=0; geninterrupt(0x33); //initialisation
_AX=7; // nø de l'interruption
_CX=5; _DX=634; // Xmin & Xmax
geninterrupt(0x33);
_AX=8; // nø de l'interruption
_CX=5; _DX=475; // Ymin & Ymax
geninterrupt(0x33);
_AX=1; geninterrupt(0x33); //Affichage du curseur
_AX=4; //nø de l'interruption
_CX=78; //X initiale du curseur
_DX=100; //Y initiale du curseur
geninterrupt(0x33);
do
{
do
{ _AX=3; //coute permanente d'un ventuel click
geninterrupt(0x33);
}while(_BX==0);
if(_BX==1) //click sur le boutton gauche
{
if((600<_CX&&_CX<620)&&(20<_DX&&_DX<30)) {closegraph();exit(0);}
if((200<_CX&&_CX<500)&&(100<_DX&&_DX<140)) { cleardevice();
setbkcolor(5);
delay(20);
setbkcolor(2);
cleardevice();
getch();
exit(0);}
}
}while(1);
}
void main()
{
graph();setbkcolor(1); setfillstyle(5,2);
setcolor(10);
settextstyle(4,0,6);
outtextxy(20,20," DOT-_-NET");
setcolor(RED);
settextstyle(0,0,0);
bar3d(600,20,610,30,3,1);
outtextxy(600,20,"X");
setfillstyle(8,9);
settextstyle(1,0,0);
bar3d(200, 100, 500,140, 10, 4);
setcolor(YELLOW);
outtextxy(250,100,"Developpez");
souris();
} |
Partager