The code you provided will break if there is no "\n" in the resource string. If you have a long
status bar string and no ToolTip then you get realy big buttons. I have included a function which acts the
same way MFC does. It will get the string after the first "\n". If more than one "\n"
chars appear in the string it gets only whats between the first and second "\n".
// Look for string resource with same ID as control and find what
// is on the right side of the "\n". Copies string to strResult and
// returns TRUE if string found and contains "\n" otherwise places
// _T("") in strResult and returns FALSE;
BOOL ToolTipFromID( UINT uID, CString &strResult)
strResult = _T("");
// Get the resource string if there is one.