什么参数传递给mshtml.dll? [英] What parameters to pass to mshtml.dll?

查看:52
本文介绍了什么参数传递给mshtml.dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在尝试使用mshtml.dll打印HTML文件.在我找到的html文件注册表中查找以下打印到条目:

I am currently trying to print a HTML file using mshtml.dll. Looking up in the registry I found for html-files, the following print-to entry:

"%systemroot%\system32\rundll32.exe" 
    "%systemroot%\system32\mshtml.dll",PrintHTML "%1" "%2" "%3" "%4"

出乎意料的是,有一些参数要传递给mshtml.dll,mshtml.dll的参数是什么(在此注册表信息中编号为%1,%2,%3,%4)?

Unexpectedly there are some parameters to pass to mshtml.dll, what are the parameters of mshtml.dll (numbered %1, %2, %3, %4 in this registry information)?

推荐答案

您在htmlfile progid的 printto 动词中发现了此问题.当您从资源管理器中拖动HTML文件并将其放在打印机快捷方式上时,该文件将运行.printto动词具有以下参数:

You found this in the printto verb of the htmlfile progid. Which runs when you drag an HTML file from Explorer and drop it on a printer shortcut. The printto verb has these arguments:

%1:HTML文件的路径
%2:打印机名称
%3:打印机驱动程序名称(可选)
%4:打印机端口名称(可选)

%1: the path to the HTML file
%2: the printer name
%3: the printer driver name (optional)
%4: the printer port name (optional)

依赖未公开功能是不明智的,您不能依靠它在下一Windows版本中仍然可以正常工作.使用WebBrowser.Print()是有记载的方法.IWebBrowser2 :: ExecWB()以本机代码显示.

Taking a dependency on an undocumented function is unwise, you can't rely on this still working in the next Windows version. Using WebBrowser.Print() is the documented way. IWebBrowser2::ExecWB() in native code.

这篇关于什么参数传递给mshtml.dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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