I found some code in
an article here[
^] that shows how to do this. Here are the steps :
First - declare the method in the control's class declaration :
afx_msg void OnKillFocus( CWnd* pNewWnd );
Second - add an entry for the message in the control's message map :
ON_WM_KILLFOCUS()
Third - add the implementation of the override :
void CColourPopup::OnKillFocus( CWnd* pNewWnd )
{
__super::OnKillFocus( pNewWnd );
ReleaseCapture();
}
This is the implementation for this particular control and may not necessary in your implementation. Especially if you do not explicitly capture the mouse.