Just add this code to your PreCreateWindow function:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) {

cs.style =~ FWS_ADDTOTITLE;
cs.name = "My title";

}