Get the menu of your window first, then use GetMenuString method CWnd::GetMenu CMenu* GetMenu( ) const; CMenu::GetMenuString int GetMenuString( UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags ) const;int GetMenuString( UINT nIDItem, CString& rString, UINT nFlags ) const;
summer_xzw(雪落黄昏) 说得对, GetDlgItem(ID_MYID)->GetWindowText(str);看看MSDN CWnd::GetWindowText int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;void GetWindowText( CString& rString ) const;Return ValueSpecifies the length, in bytes, of the copied string, not including the terminating null character. It is 0 if CWnd has no caption or if the caption is empty
CWnd::GetMenu
CMenu* GetMenu( ) const;
CMenu::GetMenuString
int GetMenuString( UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags ) const;int GetMenuString( UINT nIDItem, CString& rString, UINT nFlags ) const;
GetDlgItem(ID_MYID)->GetWindowText(str);看看MSDN
CWnd::GetWindowText
int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;void GetWindowText( CString& rString ) const;Return ValueSpecifies the length, in bytes, of the copied string, not including the terminating null character. It is 0 if CWnd has no caption or if the caption is empty