The TCM_HITTEST message determines which tab, if any, is at a specified screen position. You can send this message explicitly or by using the TabCtrl_HitTest macro.
TCM_HITTEST wParam = 0; // not used; must be zero lParam = (LPARAM) (TC_HITTESTINFO FAR *) pinfo; \\pointer to struct specifying position to test
Returns the index of the tab or - 1 if no tab is at the specified position.