WM_SETFOCUS
hwnd = (HWND) wParam; /* handle of window losing focus */
The WM_SETFOCUS message is sent after a window gains the input focus.
hwnd
Value of wParam. Contains the handle of the window that loses the input focus. (This parameter may be NULL.)
An application should return zero if it processes this message.
To display a caret, an application should call the appropriate caret functions at this point.