(* uses MsHTML, Variants, ActiveX *)
procedure ChangeHTMLSelectElement(
const SelectElement: IHTMLSelectElement;
const Value:
String);
const
IID_NULL: TGUID = (
D1:$00000000;D2:$0000;D3:$0000;D4:
($00,$00,$00,$00,$00,$00,$00,$00));
var
DispParams: TDispParams;
PDispOnChange: PDispatch;
DispOnChange: IDispatch;
ResultVar: Variant;
begin
SelectElement.Value:= Value;
DispOnChange:= SelectElement.OnChange;
PDispOnChange:= @DispOnChange;
DispParams.rgvarg:=
nil;
DispParams.rgdispidNamedArgs:=
nil;
DispParams.cArgs:= 0;
DispParams.cNamedArgs:= 0;
PDispOnChange.Invoke(DISPID_VALUE,
IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD,
DispParams, PVariant(@ResultVar),
nil,
nil);
end;
OleVariant(DeinIHTMLElement).FireEvent('
onchange') ;
oder
OleVariant(DeinIHTMLInputElement).FireEvent('
onchange');
oder
OleVariant(DeinElement
as IHTMLElement).FireEvent('
onclick');
etc.