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的呀!
///////////
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的呀!
解决方案 »
- 又见蓝屏!!
- 微软语音识别引擎可以作为ActiveX控件使用吗?
- 创建在CGfxOutBarCtrl里的CTreeCtrl怎么响应双击item消息
- 不断创建查询线程,但没有释放线程句柄,知道程序退出时才释放,会对系统有什么影响吗?
- 请问怎样获得一个类、对话框的指针?!
- IActiveDesktop问题,不但给分,而且给钱!
- 在windows下用STL技术写出的程序能否无须改动的在LINUX下正常运行?
- 抛出异常? 问题请教!
- #######简单问题,来拿分!——如何关闭DoModal()?######
- vc写的程序运行时出现mfc42d.dll没找到?why?
- 请问写软件怎么样才能入门?
- 寻求著名vc的英文讨论区网址!请赐教!
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.