indows程序设计第6章有一个KeyView2程序的一个问题:
///////////
     switch (message)
     {
     case WM_INPUTLANGCHANGE:
          dwCharSet = wParam ;
                                   // fall through
     case WM_CREATE:
     case WM_DISPLAYCHANGE:
     
               // Get maximum size of client area          cxClientMax = GetSystemMetrics (SM_CXMAXIMIZED) ;
          cyClientMax = GetSystemMetrics (SM_CYMAXIMIZED) ;              // Get character size for fixed-pitch font          hdc = GetDC (hwnd) ;          SelectObject (hdc, CreateFont (0, 0, 0, 0, 0, 0, 0, 0,
                                   dwCharSet, 0, 0, 0, FIXED_PITCH, NULL)) ; 
               
          GetTextMetrics (hdc, &tm) ;
          cxChar = tm.tmAveCharWidth ;
          cyChar = tm.tmHeight ;          DeleteObject (SelectObject (hdc, GetStockObject (SYSTEM_FONT))) ;
          ReleaseDC (hwnd, hdc) ;               // Allocate memory for display lines          if (pmsg)
               free (pmsg) ;          cLinesMax = cyClientMax / cyChar ;
          pmsg = malloc (cLinesMax * sizeof (MSG)) ;
          cLines = 0 ;
                                   // fall through
     case WM_SIZE:
          if (message == WM_SIZE)
          {
               cxClient = LOWORD (lParam) ;
               cyClient = HIWORD (lParam) ;
          }
               // Calculate scrolling rectangle          rectScroll.left   = 0 ;
          rectScroll.right  = cxClient ;
          rectScroll.top    = cyChar ;
          rectScroll.bottom = cyChar * (cyClient / cyChar) ;          InvalidateRect (hwnd, NULL, TRUE) ;//不懂        if (message == WM_INPUTLANGCHANGE)
//               return TRUE ;//          return 0 ;
/////////////       
我不懂的是if (message == WM_INPUTLANGCHANGE)
               return TRUE ;
表明message 是WM_INPUTLANGCHANGE,从返回true是什么意思呀?
过去见到的总是返回0的呀!

解决方案 »

  1.   

    返回TRUE, 表明消息已被正确处理。
      

  2.   

    这样做的目的是截获消息WM_INPUTLANGCHANGE,且什么事情也不做,相当于屏蔽了该消息
      

  3.   

    WM_INPUTLANGCHANGE
    The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on.