HWND SetFocus(HWND hWnd) function set the focus at window, and DRAWITEMSTRUCT struct has member variable for item state.
typedef struct tagDRAWITEMSTRUCT {
UINT CtlType;
UINT CtlID;
UINT itemID;
UINT itemAction;
UINT itemState;
HWND hwndItem;
HDC hDC;
RECT rcItem;
ULONG_PTR itemData;
} DRAWITEMSTRUCT;
void CMyControl::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
BOOL bIsFocus = (lpDIS->itemState & ODS_FOCUS);
...
DRAWITEMSTRUCT itemstate[
^]