open default browser with a post in Delphi

Brad picture Brad · May 16, 2010 · Viewed 7.3k times · Source

I know in delphi you can open the default browser with:

ShellExecute(self.WindowHandle,'open','www.website.com',nil,nil, SW_SHOWNORMAL);

but I'm wanting to know if there is a way to automatically post data on the new opened brower window OR auto fill the login data (even in firefox, safari,etc)

Thanks

-Brad

Answer

TridenT picture TridenT · May 16, 2010

You can launch your browser with OLE, and use the navigate function to pass data and context to the url.

Open IE with OLE

MyBrowser := CreateOleObject('InternetExplorer.Application') as IWebBrowser2;

Send data to url

MyBrowser.Navigate('http://mysite.com', Flags, EmptyParam, PostData, Headers);

See here for an example of navigate function: http://forums.devshed.com/showpost.php?p=2408145&postcount=2

I hope this will help !