pf2
asked on
How do open up a browser...
I am writing a Delphi app and would like to know how to include a link to my web site and also to my e-mail.
I would like to know how to make it so that the user just clicks and the default browser opens up and goes to my site.
I know I have to use ShellExecute but how would I go about this?
I would like to know how to make it so that the user just clicks and the default browser opens up and goes to my site.
I know I have to use ShellExecute but how would I go about this?
You can also do this
function MyCreateProcess(sExecutabl eFilePath : string): string;
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof( si), 0 );
si.cb := sizeof( si );
CreateProcess(Nil, PChar(sExecutableFilePath) , Nil, Nil, False,
NORMAL_PRIORITY_CLASS, Nil, Nil, ci, pi);
//wait until done
CloseHandle (pi.hProcess);
CloseHandle(pi.hThread);
end;
function MyCreateProcess(sExecutabl
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof( si), 0 );
si.cb := sizeof( si );
CreateProcess(Nil, PChar(sExecutableFilePath)
NORMAL_PRIORITY_CLASS, Nil, Nil, ci, pi);
//wait until done
CloseHandle (pi.hProcess);
CloseHandle(pi.hThread);
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is how to use it.....
ShellExecute(0, 'open', 'http:\www.yahoo.com',nil,nil, SW_NORMAL);//for website...
ShellExecute(0, 'open', 'mailto:viktor@megsinet.ne t',nil,nil , SW_NORMAL);//for e-mail
Hope this helps =)
Regards,
Viktor Ivanov
ShellExecute(0, 'open', 'http:\www.yahoo.com',nil,nil, SW_NORMAL);//for website...
ShellExecute(0, 'open', 'mailto:viktor@megsinet.ne
Hope this helps =)
Regards,
Viktor Ivanov
Simplest way:
uses ...ShellAPI; // don't forget
ShellExecute( 0, 'open', 'http://www.mydomain.com/~MyName/StartPage.html', nil, nil, SW_SHOW );
/// John