What notification do you get if any window loses focus?
WM_KILLFOCUS. In case you don't care, wParamwill be a handle to the window receiving the focus.
WM_KILLFOCUS
wParam
WM_ACTIVATE