www.pudn.com > cwin.rar > GETXYC.C


    /*----------------------------------------------------------- 
        函数 getxyc : 编辑字符数据 
    -----------------------------------------------------------*/ 
    #include  
    #include  
 
    unsigned _Cdecl getxyc(col,line,value,set) 
    int col;             /* 编辑窗口左上角列坐标(以字节为单位) */ 
    int line;            /* 编辑窗口左上角行坐标(以象素为单位) */ 
    int *value;          /* 指向待编辑的字符数据的指针         */ 
    char *set;           /* 允许使用的字符集合                 */ 
    { 
        char buff[2]; 
        unsigned h; 
 
        /*-- 构造编辑缓冲区 -------------------*/ 
        buff[0] = *value; 
        buff[1] = 0; 
 
        /*-- 对非法输入值循环 -----------------*/ 
        while(1) 
        { 
            h = getxya(col,line,1,buff,NULL); 
            if(strchr(set,buff[0]) || h==KEY_ESC) 
                break; 
            else 
            { 
                sound(900); 
                delay(100); 
                nosound(); 
            } 
        } 
 
        /*-- 构造输出结果 ---------------------*/ 
        if(h!=KEY_ESC) 
            *value = buff[0]; 
 
        /*-- 返回退出编辑状态的键盘码 ---------*/ 
        return h; 
    }