- // isn't the case automatically
- wxASSERT_MSG( ::GetNextWindow((HWND)m_hGripper, GW_HWNDNEXT) == 0,
+ // isn't the case automatically (but notice that this could be false if
+ // we're not shown at all as in this case ResizeGripper() might not
+ // have been called yet)
+ wxASSERT_MSG( !IsShown() ||
+ ::GetNextWindow((HWND)m_hGripper, GW_HWNDNEXT) == 0,