title: How to get the currently selected text in a CComboBoxEx?
body: <p>My first approach to the problem was to call the <code>GetWindowsText</code> method on the <a href="https://docs.microsoft.com/en-us/cpp/mfc/reference/ccomboboxex-class?view=vs-2019" rel="nofollow noreferrer">CComboBoxEx</a> control, but I found that there is no associated text. After analyzing the control with <a href="https://docs.microsoft.com/it-it/visualstudio/debugger/introducing-spy-increment?view=vs-2019" rel="nofollow noreferrer">Spy++</a> and reading some documentation on <code>CComboBoxEx</code>, I realised that these type of controls are only the parent of a classic <a href="https://docs.microsoft.com/en-us/cpp/mfc/reference/ccombobox-class?view=vs-2019" rel="nofollow noreferrer">ComboBox</a>:</p>
  
  <p><a href="https://i.stack.imgur.com/FnXNc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FnXNc.png" alt="Spy&#39;s screenshot"></a></p>
  
  <p>I tried using the <a href="https://docs.microsoft.com/en-us/cpp/mfc/reference/ccombobox-class?view=vs-2019#getlbtext" rel="nofollow noreferrer"><code>GetLBText()</code></a> method on the child ComboBox, passing <a href="https://docs.microsoft.com/en-us/cpp/mfc/reference/ccombobox-class?view=vs-2019#getcursel" rel="nofollow noreferrer"><code>GetCurSel()</code></a> as an argument, but I only get some wrong text (the correct text should be "English"):</p>
  
  <p><a href="https://i.stack.imgur.com/Fjeg7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fjeg7.png" alt="Wrong text"></a></p>
  
  <p>Am I missing something? Thanks in advance!</p>