type
TForm1 =
class(TForm)
...
private
ComboBox3: HWND;
end;
implementation
uses
Winapi.CommCtrl;
procedure TForm1.Button1Click(Sender: TObject);
var
Style: Integer;
begin
...
Style := GetWindowLong(ComboBox3, GWL_STYLE);
SetWindowLong(ComboBox3, GWL_STYLE, Style);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ComboBox3 := CreateWindowEx(0, WC_COMBOBOX, '
', WS_VSCROLL
or CBS_HASSTRINGS
or CBS_AUTOHSCROLL
or CBS_DROPDOWN
or WS_CHILD
or WS_OVERLAPPED
or WS_VISIBLE,
ComboBox2.Left, ComboBox2.Top+30, ComboBox2.Width, ComboBox2.Height,
Self.Handle, 0, HInstance, 0);
SendTextMessage(ComboBox3, CB_ADDSTRING, 0, '
ComboBox3');
SetWindowText(ComboBox3, '
ComboBox3');
end;