void CMyControl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { CDC dc; dc.Attach(lpDrawItemStruct->hDC); if (lpDrawItemStruct->itemState & ODS_FOCUS) { // Draw focus rectangle dc.DrawFocusRect(&lpDrawItemStruct->rcItem); } dc.Detach(); }In this example, the DrawItem function is called when the control is being drawn. The lpDrawItemStruct parameter contains information about the control being drawn, including its device context handle (hDC) and item state (itemState). If the itemState contains the ODS_FOCUS flag, it means that the control has focus, and the focus rectangle should be drawn around it. It is difficult to determine the package library without more information about the code. However, the code appears to be Win32-specific, so it may be using the Microsoft Foundation Classes (MFC) library which provides an object-oriented wrapper over the Win32 API.