各位大侠!!!请用最简洁的方法判断输入的是否是汉字!送分体!

解决方案 »

  1.   

    对汉字的首字节进行判断
    IsDBCSLeadByteEx(936, a);
      

  2.   

    The IsDBCSLeadByteEx function determines whether a specified byte is a lead byte, that is, the first byte of a two-byte character in a double-byte character set (DBCS) for the specified code page. BOOL IsDBCSLeadByteEx(
      UINT CodePage,   // identifier of code page
      BYTE TestChar    // byte to test
    );
    Parameters
    CodePage 
    [in] Identifier of the code page used to check lead-byte ranges. This parameter can be one of the values given in the "Code-Page Identifiers" table in Unicode and Character Set Constants or one of the following predefined values. Value Meaning 
    CP_ACP Use system default ANSI code page. 
    CP_MACCP Windows NT/2000/XP: Use the system default Macintosh code page. 
    CP_OEMCP Use system default OEM code page. 
    CP_THREAD_ACP Windows 2000/XP: Use the current thread's ANSI code page. 
      

  3.   

    //判断是否为中文
    Bool ischinesechar(const char ch)
    {
         if(ch&0x08)
          {
               return TRUE;
           }
         else
             return FALSE;
    }
      

  4.   

    BOOL IsChineseChar(char ch)
    {
      return (ch & 0x80);
    }在WIN32程序中,需要响应 WM_CHAR 消息来判断:
    .
    case WM_CHAR:
     if(IsChineseChar((char)wParam))
     {...}
     break;
    .
    .