首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

关于鼠标控制有关问题

2012-02-10 
关于鼠标控制问题.小弟写了一个鼠标控制的程序.省去了头文件和无关内容.main(){gotoxy(10,6)cprintf( Wr

关于鼠标控制问题.
小弟写了一个鼠标控制的程序.省去了头文件和无关内容.
main()
{
gotoxy(10,6);
cprintf( "Write   New   Numbers. ");
getmouse(&button,&x,&y);
    /*下面是我不懂的,那些有小刮号的值应该是多少?*/
if(x/8> =(10)&&x/8 <=(18)&&y/8==(这里应该是多少请指教)&&button&1==1)
                            {
                                printf( "YES ");getch();
                            }
}
getmouse(int   *button,int   *mousex,int   *mousey)
{
      union   REGS   r;
    r.x.ax=3;
    int86(0x33,&r,&r);
    *button=r.x.bx;
      *x=r.x.cx;
      *y=r.x.dx;
}
在屏幕的第6行第10列显示 "Write   New   Numbers. "
我想让鼠标点在这个区域就输出个 "YES ".但为什么没反应?

[解决办法]
if(x/8> =(10)&&x/8 <=(18)&&y/8==(这里应该是多少请指教)&&button&1==1)
确定在哪部分区域内点击之后打印:
应该这样:
if(x/8> =10&&x/8 <=10+strlen( "Write New Numbers. ") &&y/8> 5*textheight( 'a ')&&y/8 <6*textheight( 'a ') &&button&1==1)

热点排行
Bad Request.