C语言图形模式下的问题
来源:百度知道 编辑:UC知道 时间:2024/06/17 02:36:25
请问可不可以鼠标和光标同时都出现呢?
在图形模式下, 其光标是人工画出来的.
下面给一个简单的例子,希望对你有帮助:
说明,本程序用TC2.0编译,记得要有"EGAVGA.BGI"图形驱动文件.
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
#include<malloc.h>
union REGS Mouse;
int MAXX=0,MAXY=0;
int HAVE_MOUSE=0;
int MOUSE_SHOW=0;
int Save_Background[256];
int Old_Mousex=0,Old_Mousey=0;
int Mouse_x=0,Mouse_y=0;
unsigned char Left_Button_Down=0,Right_Button_Down=0;
int move=0;
void Initialize_VGA(void);
void Reset_Mouse(void);
void Show_Mouse_Cursor(void);
void Set_Mouse_Position(int x,int y);
void Get_Background(void);
void Put_Background(void);
void Draw_Mouse_Cursor(void);
void Get_Mouse_Button(unsigned char *Lbutton,unsigned char *Rbutton,int *x,int *y);
unsigned int Arrow[32]={
0x9fff,0x8fff,0x87ff,0x83ff,
0x81ff,0x80ff,0x807f,0x803f,
0x801f,0x800f,0x80ff,0x887f,
0x987f,0xfc3f,