---------------------------------------------
1. 一个函数, 选中与字符串匹配的ComboBox项目
function CB_SelectItem(hComboBox: HWND; const sItem: string): Boolean;
var
CB_Index: Integer;
begin
Result := FALSE;
CB_Index := SendMessage(hComboBox, CB_FINDSTRING, -1, LongInt(@sItem[1]));
if (CB_Index = CB_ERR) then Exit;
if (SendMessage(hComboBox, CB_SETCURSEL, CB_Index, 0) = CB_ERR) then Exit;
SendMessage(GetParent(hComboBox), WM_COMMAND, MakeLong(GetDlgCtrlID(hComboBox), CBN_SELCHANGE), hComboBox);
Result := TRUE;
end;
如果只要选中第二个, 直接发CB_SETCURSEL即可, 最好再发一个WM_COMMAND给父窗口,通知变化
---------------------------------------------
2. 向按钮发送 BM_CLICK 消息, 就相当于单击了 。
---------------------------------------------