Home > Database > Mysql Tutorial > 小技巧:不显示打印对话框直接打印网页到打印机

小技巧:不显示打印对话框直接打印网页到打印机

WBOY
Release: 2016-06-07 15:17:05
Original
1599 people have browsed it

找了一段时间,发现了MSHTML没有提供绕开打印对话框的方法。昨天试了下一个Windows Web Browser Control,居然可以了,下面做个记录: m_Browser.Navigate(sHttpAddress, vtNULL, vtNULL, vtNULL, vtNULL); m_Browser.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DON

找了一段时间,发现了MSHTML没有提供绕开打印对话框的方法。昨天试了下一个Windows Web Browser Control,居然可以了,下面做个记录:

 m_Browser.Navigate(sHttpAddress, &vtNULL, &vtNULL, &vtNULL, &vtNULL);
 m_Browser.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER,NULL,NULL);

 

或许有人也会遇到这样的问题! 曾看过一些人提到的想法,还需要捕获到Printer Dialog,然后传送消息,有点麻烦。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template