【问题标题】:shellexecute fails to open http links for some usersshellexecute 无法为某些用户打开 http 链接
【发布时间】:2011-02-26 15:07:20
【问题描述】:

我的应用程序的一些用户报告链接未在浏览器中打开。我总是用 shellexecute(0, 'open', 'http://...

我可以在 http 链接关联中检查不正确的 (?) 设置吗?

【问题讨论】:

    标签: delphi http browser shellexecute


    【解决方案1】:

    您假设浏览器注册了open 动词。它可能没有这样做。

    只需传递 nil 作为第二个参数并省略 open,让操作系统确定 http:// 协议的默认操作是什么,你应该没问题。

    【讨论】:

      【解决方案2】:

      听起来默认浏览器运行不正常。我想我会尝试的第一件事是让他们在 start->run 中输入一个(任何)url,看看是否会弹出。

      您也可以让他们注册以下 URL 上的设置:

      http://russenreaktor.wordpress.com/2010/07/01/solved-fix-default-protocol-http-association-in-windows/

      或者在 cmdline 上使用 ftype 实用程序:

      C:\Users\marco>ftype http http="C:\Program Files (x86)\Internet Explorer\iexplore.exe" -nohome

      这些对 HKEY_CLASSES_ROOT/protocolname 下的注册表项进行操作,protocolname=http/ftp 等。

      制作一个简单的应用程序来转储这些密钥可能有助于找出这里的模式。

      【讨论】:

        【解决方案3】:

        仅供参考,此故障可能是动态的 - 即,旧的 MS PhotoEditor 会阻止使用 ShellExecute 打开 URL。 (参见http://code.activestate.com/recipes/334665/)。修复方法如配方中所述:写出一个 .HTML 文件并用 shell 执行它。

        【讨论】:

          猜你喜欢
          • 2012-06-25
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-02-07
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多