int f_index = 2;//select index 2 on combobox.
int l_ComBoxHandle = f_automationElement.Current.NativeWindowHandle;
SendMessage((IntPtr)l_ComBoxHandle, CommonDef.WM_LBUTTONDOWN, f_index, 0);
SendMessage((IntPtr)l_ComBoxHandle, CommonDef.WM_LBUTTONUP, f_index, 0);
int l_result = SendMessage((IntPtr)l_ComBoxHandle, CommonDef.CB_SETCURSEL, f_index, 0);
SendMessage((IntPtr)l_ComBoxHandle, CommonDef.WM_LBUTTONDOWN, f_index, 0);
SendMessage((IntPtr)l_ComBoxHandle, CommonDef.WM_LBUTTONUP, f_index, 0);
如何使用C ++通过选择更改事件触发来设置组合框的索引