注意搜索撒,百度,google都可以嘛,这里有个英文解释,应该看得懂吧!
GetTypefaceAtCaret is a CStyleBar helper function that retrieves font information from the document or from the view and returns a CString with the typeface name. After GetTypefaceAtCaret returns,CComboBox::SelectString is called to select the corresponding combo box item, and CComboBox::SetCurSel is called with a -1 to blank the visible portion of the combo box if SelectString fails. With this simple update handler in place, the combo box selection will stay in sync with the caret as the user cursors through the document.
应用例子:
CString string = GetTypefaceAtCaret ();
if (m_wndComboBox.SelectString (-1, string) == CB_ERR)
m_wndComboBox.SetCurSel (-1);