1. Luc Railhac
  2. PowerBuilder
  3. Friday, 5 April 2024 13:13 PM UTC

Hi,

Our PB2022 R3 app is installed on a Citrix server and, when the app opens an URL, our ITs want to use the client web browser instead of the default browser on the server.

According to them, the behavior of HyperLinkToURL() and OpenURL() are not the same:

HyperLinkToURL()
HKCR\HTTP\shell\open\command -> allows host to client redirection and opening of the client browser

OpenURL()
HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice -> default server web browser

Is there a way to allow redirection without using the obsolete Inet object and HyperLinkToURL() method?

Thanks,
Luc

Accepted Answer
kitty he @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 April 2024 08:38 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Luc,

 

We added the openurl feature with security in mind. Currently, openurl can only use the default browser. As for Hyperlinktourl, we've marked it as obsolete, but the functionality still exists, so you can continue to use it.

 

Regarding the differences with Hyperlinktorurl, I will provide feedback to the development team to see if we can implement allowing host to client redirection and opening of the client browser.

 

Best regards,

Kitty

Comment
  1. Luc Railhac
  2. Wednesday, 10 April 2024 08:57 AM UTC
Thanks a lot!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 10 April 2024 17:59 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Luc -

A couple of years ago I posted in CodeXchange a "Get Default Browser" PB function that might help you accomplish your goal. It can be found here:

    https://community.appeon.com/index.php/codeexchange/powerbuilder/313-a-get-default-browser-function#414

Best regards, John

Comment
There are no comments made yet.
Bruce Armstrong Accepted Answer Pending Moderation
  1. Wednesday, 10 April 2024 17:18 PM UTC
  2. PowerBuilder
  3. # 2

>>Do you know exactly why Appeon wants to get rid of the Inet object, as it is not obvious to us?

As Kitty indicated, the object is a wrapper around a rather old Windows API interface.  One that is obsolete and should no longer be used.  All of the functionality of the inet object was already available through other newer objects, such as HTTPClient.  The OpenURL function was added to replace the one remaining thing in inet that wasn't supported by something newer.

>> this section of code in the second example defeats our purpose

Correct.  You do *not* want to use ShellExecuteEX if you want to allow client redirection.  You want to use ShellExecute.  Very similar names, but they work completely different.

Comment
There are no comments made yet.
Bruce Armstrong Accepted Answer Pending Moderation
  1. Sunday, 7 April 2024 18:47 PM UTC
  2. PowerBuilder
  3. # 3

It looks like HyperLinktoUrl was using ShellExecute under the covers.  You can code that directly if you want your application to go through that route.

https://www.rgagnon.com/pbdetails/pb-0008.html

 

Comment
  1. Luc Railhac
  2. Wednesday, 10 April 2024 05:14 AM UTC
Thanks Bruce,



This is really helpful for .html and other file extensions as well, we will try this.



Our app opens a lot of .pdf and .docx, we do this by setting the path of AcrobatReader/Word.exe in the .ini file but your method seems better.



For html however, this section of code in the second example defeats our purpose:



IF lower(as_extension) = "htm" OR lower(as_extension) = "html" THEN

// Open html file with HyperlinkToURL

// So, a new browser is launched

// (with the code using ShellExecuteEx, it is not sure)

GetContextService("Internet", l_Inet)

ll_ret = l_Inet.HyperlinkToURL(as_file)



Do you know exactly why Appeon wants to get rid of the Inet object, as it is not obvious to us?

Is this a big problem if we still use Inet in our app?



Thanks again,

Luc

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.