Security for Print Service RRS feed

  • Question

  • Hi,   

    Below is the scenario

    1) Whenever user does an CNTRL + P event from word,excel, text etc... we need to override PrintDialog and show our custom windows form (c#.net).

    2) That windows form contains a Textbox and a Submit Button, so user will enter reason in the textbox and then clicks on Submit Button which should perform silent printing.

    Once thing to note here is Printer would be connected in network() not on the user machine.

    Any idea / suggestion  or a code block to implement the above mentioned scenario is highly appreciated.

    Regards, Dillu

    Friday, December 5, 2014 8:17 AM

All replies

  • This would be quite complicated if it were to be done universally, but in and of itself seems like a poor way to accomplish whatever it is that you're trying to accomplish.  What is your end goal? 

    WinSDK Support Team Blog: http://blogs.msdn.com/b/winsdk/

    Wednesday, December 10, 2014 6:24 PM
  • Hello Chris,

                      My main task is to pause printing (Printer would be connected in network not on the user machine)  whenever user does a CNTRL + P event  and pop up a windows form (windows form pop up can be before printdialog or after printdialog )   with a text box and a  submit button  and RESUME printing upon clicking  Submit button from that Windows Form.

    Regards, Dillu

    Thursday, December 11, 2014 2:39 PM
  • Can you give some more details on what you're trying to accomplish?  Is this for a product or an internal IT thing?   There aren't any programmatic ways that are supported by Microsoft to do what you're asking on a global basis.  Things that may technically work without being supported would be extremely complex and could not be implemented entirely in managed code.  It certainly could be possible for specific programs if they provide an entry point for you execute code at those places; you'd have to research each program for that.

    However, there may be other ways to accomplish your end goal.  There are many ways to accomplish getting printers connected without needing to subvert print dialog functions.   What are you trying to do that led you to want to take over the print dialog box?

    WinSDK Support Team Blog: http://blogs.msdn.com/b/winsdk/

    Thursday, December 11, 2014 2:49 PM
  • Hello Chris,

                     It is basically for a dual purpose 1) as a product and as well as for our 2) internal purpose.

    we are trying to capture number of prints taken for a particular project code.

    Our goal is not to allow user to print anything from his machine unless he enters project code.So once after entering the code in windows form we will check against the DB to validate the code and then allow him to print.

    Regards, Dillu

    • Edited by dillu Thursday, December 11, 2014 2:59 PM
    Thursday, December 11, 2014 2:57 PM
  • The proper way to implement that kind of global solution is through a user mode printer driver component and setting up printers in the organization to use it for all its printers (driver restrictions can be done via group policy to prevent users from adding new drivers).  Take a look at the Windows Driver Development kit for more information about printer drivers.

    WinSDK Support Team Blog: http://blogs.msdn.com/b/winsdk/

    Thursday, December 11, 2014 3:02 PM