views:

179

answers:

1

Does anyone know of a way to stop an SWT Browser widget from printing its contents?

In my app, this widget will display confidential files. I cannot block everything, but want to make it as difficult as possible to get information out.

I easily hide the context menu when a user right-clicks, so Print cannot be gotten to in that fashion. I overwrite the clipboard to handle print screen, Ctrl-C and Ctrl-V. But if i hit Ctrl-P, I do not want the print dialog to come up either. Any ideas?

A: 

I found a way around my situation. In this app, the admin chooses if the user can print the files or not. There is a menu bar in the app, so if printing is allowed, I add a print item in the menu with Ctrl-P as its hot key.

If printing is not allowed, I set the hot key for one of the menu options to be Ctrl-P and dont add the print option at all in the menu bar. This way it disables the print dialog from ever appearing because Ctrl-P executes a menu item function instead.