WM_ACTIVATE消息

消息: WM_ACTIVATE

参数:
fActive  = LOWORD(wParam);   // activation flag
fMinimized = (BOOL)HIWORD(wParam); // minimized flag
hwndPrevious= (HWND)lParam;   // window handle

fActive 参数主要定义了该窗口发生了什么事情,即该窗口是被激活还是被取消。该信息保存在 wParam 的低阶字中,可以取以下的值:

--------------------------------------------------------------------------------------
值                                     描述
--------------------------------------------------------------------------------------
WA_CLICKACTIVE       通过鼠标单击激活了该窗口
WA_ACTIVE                   通过鼠标以外的工具(如键盘)激活了该窗口
WA_INACTIVE               取消该窗口的激活
--------------------------------------------------------------------------------------

示例代码:

case WM_ACTIVATE:
{
     // test if window is being activated
     if(LOWORD(wParam)!=WA_INACTIVE)
     {
          // application is being activated
     }
     else
     {
          // application is being deactivated
     }
}
break;

 

转自:http://blog.csdn.net/guoqiang721029/archive/2005/03/18/322758.aspx

posted @ 2009-12-21 22:01  一个农夫  阅读(16119)  评论(0编辑  收藏  举报