I am trying to call CTabCtrl::GetCurSel() in my program and if a certain tab is selected to do a certain action. I am aware that this function returns the zero-based index of the selected tab, which is the problem for me. How can you find out the index of a tab? Any help will be greatly appreciated!!!