参数:
fActive = LOWORD(wParam); // activation flag
fMinimized = (BOOL)HIWORD(wParam); // minimized flag
hwndPrevious= (HWND)lParam; // window handle
fActive 参数主要定义了该窗口发生了什么事情,即该窗口是被激活还是被取消。该信息保存在 wParam 的低阶字中,可以取以下的值:
--------------------------------------------------------------------------------------
值 描述
--------------------------------------------------------------------------------------
WA_CLICKACTIVE 通过鼠标单击激活了该窗口
WA_ACTIVE 通过鼠标以外的工具(如键盘)激活了该窗口
WA_INACTIVE 取消该窗口的激活
--------------------------------------------------------------------------------------
1 示例代码: 2 3 case WM_ACTIVATE: 4 { 5 // test if window is being activated 6 if(LOWORD(wParam)!=WA_INACTIVE) 7 { 8 // application is being activated 9 } 10 else 11 { 12 // application is being deactivated 13 } 14 } 15 break;
WM_ACTIVATEAPP会发给被激活或失去激活的应用程序所拥有的所有窗口,比如所有的按钮,所有的EDITBOX,等等
而WM_ACTIVATE只会发给被激活或失去激活的那个窗口