Vamos a ver que sale de aquí. No tengo mucha experiencia usando el TWebBrowser, pero creo que esto puede funcionar:
Código Delphi
[-]
procedure TForm1.WebBrowser1BeforeNavigate2(ASender: TObject;
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant; var Cancel: WordBool);
var
NewPostData: OleVariant;
begin
if VarIsArray(PostData) then
with TStringList.Create do
try
Delimiter:= '&';
DelimitedText:= String(PChar(VarArrayLock(PostData)));
VarArrayUnlock(PostData);
if Values['Vamos']=EmptyStr then
begin
Cancel:= TRUE;
Values['Pass']:= Values['Pass'] + 'hola';
Values['Vamos']:= 'Si';
NewPostData:= VarArrayCreate([0, Length(DelimitedText)], varByte);
StrCopy(PChar(VarArrayLock(NewPostData)),PChar(DelimitedText));
VarArrayUnlock(NewPostData);
(ASender as TWebBrowser).Navigate2(URL,EmptyParam,EmptyParam,
NewPostData,EmptyParam);
end;
finally
Free;
end;
end;
Bueno, seguro que se puede hacer mejor, pero es un comienzo. Por cierto 'Pass' es el nombre que tiene el campo password en el formulario y 'Vamos' tiene que ser un nombre que no corresponda con el de ningún campo del formulario.