Page 1 of 1

Re: Intercepting print dialog

Posted: Fri Oct 26, 2018 7:57 am
by salvadordf
As far as I know, there are two ways to disable printing :
  • 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

Re: Intercepting print dialog

Posted: Sat Oct 27, 2018 7:53 am
by salvadordf
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 :

Code: Select all

frame.ExecuteJavascript('window.print=function(){}', 'about:blank', 0);
This would override the window.print function in every loaded frame.