Em nhặt đc đoạn code trong mục [b]Thủ thuật và mẹo vặt[/b[], nhưng sao lại chay ko được nhỉ? Em xài Borland C++

C Code:
  1. #include <dos.h>
  2. #include <graphics.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. #ifndef _MOUSE_CPP
  7. #define _MOUSE_CPP
  8.  
  9. #define INT_MOUSE    0x33  //Ngat chuot
  10.  
  11. #define MOUSE_INIT   0x00  //Chuc nang 0 --> khoi tao chuot
  12. #define MOUSE_SHOW   0x01  //Chuc nang 1 --> hien chuot
  13. #define MOUSE_HIDE   0x02  //Chuc nang 2 --> an chuot
  14. #define MOUSE_POS    0x03  //Chuc nang 3 --> lay toa do chuot
  15. #define MOUSE_MOVE   0x04  //Chuc nang 4 --> di chuyen chuot
  16. #define MOUSE_DOWN   0x05  //Chuc nang 5 --> so lan an chuot
  17. #define MOUSE_UP     0x06  //Chuc nang 6 --> so lan tha chuot
  18. #define MOUSE_LIMY   0x07  //Chuc nang 7 --> xac dinh toa do gioi han y
  19. #define MOUSE_LIMX   0x08  //Chuc nang 8 --> xac dinh toa do gioi han x
  20.  
  21. #define LEFT    0
  22. #define RIGHT   1
  23. #define MIDDLE  2
  24.  
  25. #define TEXT    0
  26. #define GRAPHIC 1
  27.  
  28. typedef struct{
  29.   int click;
  30.   int n;
  31.   int x;
  32.   int y;
  33. }mouse_status;
  34. //=====================prototype============================
  35. void init_mouse();
  36. void show_mouse();
  37. void hide_mouse();
  38. void getmouse_pos(int *x,int *y,int mode);
  39. void move_mouse(int x,int y,int mode);
  40. void mouse_even(int even,int mouse,mouse_status *m,int mode);
  41. void mouse_limit(int x1,int y1,int x2,int y2,int mode);
  42. //==========================================================
  43.  
  44. void init_mouse(){
  45.   int status;
  46.   _AX=MOUSE_INIT;
  47.   geninterrupt(INT_MOUSE);
  48.   status = _AX;
  49.  
  50.   if(status==0)
  51.      printf("chua cai dat chuot");
  52. }
  53.  
  54. void show_mouse(){
  55.   _AX=MOUSE_SHOW;
  56.   geninterrupt(INT_MOUSE);
  57. }
  58.  
  59. void hide_mouse(){
  60.   _AX=MOUSE_HIDE;
  61.   geninterrupt(INT_MOUSE);
  62. }
  63.  
  64. void getmouse_pos(int *x,int *y,int mode){
  65.   _AX=MOUSE_POS;
  66.    geninterrupt(INT_MOUSE);
  67.   *x=_CX;
  68.   *y=_DX;
  69.  
  70.   if(mode==TEXT){
  71.      *x=*x/8+1;
  72.      *y=*y/8+1;
  73.   }
  74. }
  75.  
  76. void move_mouse(int x,int y,int mode){
  77.   if(mode==TEXT){
  78.      x=x/8+1;
  79.      y=y/8+1;
  80.   }  
  81.  }      
  82.  
  83.   _CX=x;
  84.   _DX=y;
  85.   _AX=MOUSE_MOVE;
  86.    geninterrupt(INT_MOUSE);
  87.  
  88. }
  89.  
  90. void mouse_even(int even,int mouse,mouse_status *m,int mode){
  91.   _BX=mouse;
  92.   _AX=even;
  93.   geninterrupt(INT_MOUSE);
  94.   m->click = _AX;
  95.   m->n     = _BX;
  96.   m->x     = _CX;
  97.   m->y     = _DX;
  98.  
  99.   if (mode==TEXT){
  100.     m->x=m->x/8+1;
  101.     m->y=m->y/8+1;
  102.   }
  103.  
  104. }
  105.  
  106. void mouse_limit(int x1,int y1, int x2, int y2,int mode){
  107.   if (mode==TEXT){
  108.     x1 = (x1-1)*8;
  109.     y1 = (y1-1)*8;
  110.     x2 = (x2-1)*8;
  111.     y2 = (y2-1)*8;
  112.   }  
  113.  
  114.   _CX = x1;
  115.   _DX = x2;
  116.   _AX = MOUSE_LIMX;
  117.   geninterrupt(INT_MOUSE);
  118.  
  119.   _CX = y1;
  120.   _DX = y2;
  121.   _AX = MOUSE_LIMY;
  122.   geninterrupt(INT_MOUSE);
  123. }
  124.  
  125. #endif