'How to catch leaving focus from active window

I have window with CTabsCtrl - with child window. I need to catch situation, when user leave rigth window (window with brown border and blue background) and click to ctreectrl on the left (marked with yellow border). I tried WW_LOST_FOCUS but it doesn't work.

How to do it?

(I need to save value in right window since user change item in CtreeCtrl)

Thanks for help.enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source