Hmm tak to se omlouvam ono mi to totiž nechce chodit ani v WinME
a asi sem prisel na to kde je chyba kdyz je spostene ICQ tak mi to napise "Server RPC nelze najit " to same kdyz to ladim
ale kdyz to pustim normalne tak to chodi v poho.
Ale stejne to porad nechapu prikladam zdrojak
prekopany sluzi k posilani sms na oskar
Procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.RegisterAsBrowser := True;
Webbrowser1.Navigate('http://sms.oskarmobil.cz/s_main.php3?locale=cz&promen=');
end;
Procedure TForm1.Button2Click(Sender: TObject);
Var
ShellWindow: IShellWindows;
WB: IWebbrowser2;
spDisp: IDispatch;
IDoc1: IHTMLDocument2;
Document: Variant;
k, m: Integer;
ovElements: OleVariant;
i: Integer;
Begin
ShellWindow := CoShellWindows.Create;
For k := 0 To ShellWindow.Count Do
Begin
spDisp := ShellWindow.Item(k);
If spDisp = Nil Then
Continue;
spDisp.QueryInterface(iWebBrowser2, WB);
If WB <> Nil Then
Begin
WB.Document.QueryInterface(IHTMLDocument2, iDoc1);
If iDoc1 <> Nil Then
Begin
WB := ShellWindow.Item(k) As IWebbrowser2;
Begin
Document := WB.Document;
For m := 0 To Document.forms.Length - 1 Do
Begin
ovElements := Document.forms.Item(m).elements;
For i := 0 To ovElements.Length - 1 Do
Begin
Try
If (CompareText(ovElements.item(i).tagname,
'TEXTAREA') = 0) And
(CompareText(ovElements.item(i).name, 'message') =
0) Then
ovElements.item(i).Value := Memo1.Lines.Text;
Except
End;
Try //INPUT maxLength=3 name=mypred1
If (CompareText(ovElements.item(i).tagname,
'INPUT') = 0) And
(CompareText(ovElements.item(i).name, 'mypred2') =
0) Then
ovElements.item(i).Value := edit1.Text;
Except
End;
Try //INPUT maxLength=8 name=mynumber
If (CompareText(ovElements.item(i).tagname,
'INPUT') = 0) And
(CompareText(ovElements.item(i).name, 'mynumber') =
0) Then
ovElements.item(i).Value := edit2.Text;
Except
End;
Try //INPUT maxLength=6 name=number
If (CompareText(ovElements.item(i).tagname,
'INPUT') = 0) And
(CompareText(ovElements.item(i).name, 'number') =
0) Then
ovElements.item(i).Value := edit3.Text;
Except
End;
Try
If (CompareText(ovElements.item(i).tagname,
'SELECT') = 0) And
(CompareText(ovElements.item(i).name, 'predcisli')
=
0) Then
ovElements.item(i).Value := ComboBox1.Text;
Except
End;
//input type=text name="sender" size=20 maxlength=30
Try
If (CompareText(ovElements.item(i).tagname,
'input') = 0) And
(CompareText(ovElements.item(i).name, 'sender')
=
0) Then
ovElements.item(i).Value := edit4.Text;
Except
End;
Try
If CheckBox1.Checked Then
Begin
If (CompareText(ovElements.item(i).tagName,
'BUTTON') = 0) And
(CompareText(ovElements.item(i).type, 'submit')
= 0)
And (ovElements.item(i).Value =
' Odeslat zprávu ') Then
ovElements.item(i).Click;
End
Except
End;
End;
End;
End;
End;
End;
End
End;