掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
URL,ID,Passwordを与えてInternet Explorerを起動するには? (ID:28715)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
下記のサンプルでは Button1 をクリックすると www.google.co.jp を表示し、 自動的に検索項目に delphi を入力し Google検索 のボタンを押します unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, MSHTML, OleCtrls, SHDocVw, StdCtrls; type TForm3 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; procedure WebBrowser1DocumentComplete(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant); procedure Button1Click(Sender: TObject); private { Private 宣言 } public { Public 宣言 } end; var Form3: TForm3; isNavigate : Boolean; implementation {$R *.dfm} procedure TForm3.Button1Click(Sender: TObject); begin WebBrowser1.Navigate('http://www.google.co.jp/'); isNavigate := True; end; procedure TForm3.WebBrowser1DocumentComplete(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant); var HTMLDoc2 : iHTMLDocument2; HTMLInputElement : iHTMLInputElement; HTMLInputImageEvent : HTMLInputImageEvents; begin if isNavigate = True then begin HTMLdoc2 := Webbrowser1.document as IHTMLDocument2; HTMLInputElement := HTMLDoc2.All.Item ('q',0) as iHTMLInputElement; HTMLInputElement.Set_Value ('delphi'); HTMLdoc2 := Webbrowser1.document as IHTMLDocument2; HTMLInputElement := HTMLDoc2.All.Item ('btnG',0) as iHTMLInputElement; HTMLInputElement.Form.Submit; end; isNavigate := False; end; end.
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.