The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.
WM_SETFOCUS hwndLoseFocus = (HWND) wParam; // handle of window losing focus
An application should return zero if it processes this message.
To display a caret, an application should call the appropriate caret functions when it receives the WM_SETFOCUS message.