<p>I need to update a <code>combobox</code> with a new value so it changes the reflected text in it. The cleanest way to do this is after the <code>combobox</code>has been initialised and with a message.</p>

<p>So I am trying to craft a <code>postmessage</code> to the hwnd that contains the <code>combobox</code>.</p>

<p>So if I want to send a message to it, changing the currently selected item to the nth item, what would the <code>postmessage</code> look like?</p>

<p>I am guessing that it would involve <code>ON_CBN_SELCHANGE</code>, but I can't get it to work right.</p>

You want
ComboBox_SetCurSel
:
```
```
ComboBox_SetCurSel(hWndCombo, n);
```
```
or if it's an MFC CComboBox control you can probably do:
```
```
m_combo.SetCurSel(2);
```
```
I would imagine if you're doing it manually you would also want SendMessage rather than PostMessage. CBN_SELCHANGE is the notification that the control sends
back to you
when the selection is changed.
Finally, you might want to add the c++ tag to this question.