在向页面提供参数时,如何通过ShellExecuteEx以编程方式调用IE. [英] How to invoke IE programmatically via ShellExecuteEx while supplying an argument to the page.

查看:98
本文介绍了在向页面提供参数时,如何通过ShellExecuteEx以编程方式调用IE.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用"open"代码编写了对ShellExecuteEx的调用.动词和一个.html文件.我可以将带有信息的字符串粘贴到IE中,该信息将传递到用作导航提示的网页.但是我无法通过将该数据直接传递到IE. ShellExecuteEx.

I have coded up a call to ShellExecuteEx using the "open" verb and a file that is a .html file. I can paste a string into IE with info that is passed to the web page that is used as a navigation hint. But I am unable to pass that data directly to IE via ShellExecuteEx.

 

我尝试设置"lpFile" Shell成员执行结构以包含文件名和参数,如下所示:"index.html#uid:selectb3c"但是ShellExecuteEx当然会查找具有该名称的文件,因此会失败.

I have tried setting the "lpFile" member of the shell execute struct to contain the file name and paramter like this: "index.html#uid:selectb3c" but of course ShellExecuteEx then looks for a file with that name and hence fails.

我还尝试将lpParameters成员设置为"#uid:selecttb3c",但是浏览器无法将数据传递到页面.相反,浏览器只是打开"index.html",这只是我需要的一半.

I also tried setting the lpParameters member to "#uid:selecttb3c" but the browser fails to pass the data to the page. Instead the browser simply opens "index.html", which is only half of what I need.

但是,如果我打开浏览器并粘贴"index.html#uid:selectb3c",进入链接字段,我得到的正是我想要的.

But if I open the browser and paste "index.html#uid:selectb3c" into the link field, I get exactly what I want.

请注意,我实际上将完整路径传递给了我的"index.html"上述每种情况下的文件.另外,我必须调用注册的默认浏览器,这就是为什么我使用"open"浏览器.动词-操作系统选择用户的默认浏览器,这就是我想要的.

Note that I actually pass the full path to my "index.html" file in each of the above cases. Also I have to invoke the registered default browser, which is why I am using the "open" verb - the OS picks the user's default browser, which is what I want.

有人知道我如何让Windows启动浏览器并提供页面"信息吗?数据添加到链接编辑字段?

Does anyone know how I can have Windows launch the browser and feed the "page" data to the link edit field?

 

推荐答案

尝试运行进程监视器以​​查看实际传递给浏览器命令行的内容.

Try run process monitor to see what is actually passed to the browser's command line.

浏览器可能会也可能不会从文件名中拆分位置字符. RFC 1630和RFC 1738中url的片段部分没有任何内容.

And browsers may or may not  split the location character from the file name. There is no word on the fragment part of the url in  RFC 1630 and RFC 1738.


这篇关于在向页面提供参数时,如何通过ShellExecuteEx以编程方式调用IE.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆