- Overwrite the window.print JavaScript function. Add this code :
Code: Select all
TChromium.ExecuteJavascript('window.print=function(){}', 'about:blank', 0);
- Hook the PrintDlg and PrintDlgEx functions in the Windows API. For more details about this, read this post message :
https://www.briskbard.com/forum/viewtop ... 2373#p2373
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Intercepting print dialog
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Intercepting print dialog
As far as I know, there are two ways to disable printing :
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Intercepting print dialog
After reading a little more about this kind of problems I would try to use the TChromium.OnLoadStart event and add this code inside that event :
This would override the window.print function in every loaded frame.
Code: Select all
frame.ExecuteJavascript('window.print=function(){}', 'about:blank', 0);