Hello,
In Powerbuilder 17 R3, I need to open an URL in the default browser of my computer.
Chrome is my default browser.
But with the next code, IE is opened instead of Chrome.
Is it normal ?
Please, how can I do to open this URL with the default browser ?
I wrote this code :
int li_rc
string ls_url
INet linet
linet = create INet
TRACE.log(THIS.ClassName() + ".ue_notif_courrier(DEBUT)")
ls_url = gnv_app.of_getURL("http://www.topaze.com")
// Appelle la page web
li_rc = this.GetContextService("Internet", linet)
if li_rc = 1 then
li_rc = linet.HyperlinkToURL(ls_url) // Ouvre IE au lieu du navigateur par défaut !!!!
//run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe " + ls_url)
end if
if isvalid(linet) then destroy linet
This code works great for Windows10!
The default browser opens, not IE.
Function long ShellExecute( long hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, integer nShowCmd) Library "shell32.dll" alias for "ShellExecuteW"
String ls_null
setnull(ls_null)
Long ll_handle
ll_handle = Handle(Parent) // ll_handle = Handle(mdiframe) // setnull(ll_handle)
ShellExecute( ll_handle, "Open", "https://...";, ls_null, "", 1)
ShellExecute( ll_handle, 'Open', 'https://...', ls_null, '', 1)
Don't forget to have a look also at https://community.appeon.com/index.php/qna/q-a/shellexecutew It's not always the 'Open' command that does the trick.
What I'm doing now, is first try with 'Open', if not successful, I try 'Edit' and if that didn't work either, I pass in a null value.
regards.