Open default browser with message in Delphi

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

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

but I want to know if there is a way to automatically send data to a new open browser window OR to automatically fill in login data (even in Firefox, Safari, etc.).

thanks

-Brad

+7
delphi delphi-2009 delphi-7 twebbrowser
source share
3 answers

You can launch your browser using 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 URL data

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

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

Hope this helps!

+4
source share

You need to add "Http: //" in front of the website name, otherwise the OS does not know which application to open.

ShellExecute (Application.Handle, 'open', ' http://www.bjmsoftware.com ', nil, nil, SW_SHOWNORMAL);

works for me in a console application.

+2
source share

No, POST data with a URL or filling out fields using ShellExecute is not possible. There is no common API, all browsers must be remotely controlled. Alternatives use GET (encoded in the URL itself) or directly linked to specific browsers, for example TridenT offers .

+2
source share

All Articles