Announcement

Collapse
No announcement yet.

Printer global restriction with password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printer global restriction with password

    I have a singular problem. I made an application, and it has an encrypted
    password to log in that application. This PC wont be running much stuff, its
    a PC dedicated to run my App, and ocassionally few other apps.

    Here's the problem, I want to prevent users from using the printer, and
    everytime they want to print something (even from programs like Office or
    Excel), i want to promt them for my App's password. When they log in my app,
    they wont be promped to input the password because they already logged in,
    but they still be promped for a password if the printing comes from another app,
    even if they are already logged in my app.

    Am i aiming too high? Is this possible?

  • #2
    I think you can set up Windows security to handle printers.

    That aside, I have to say the application sounds , well, "different."

    I can't use a printer - a system resource - without a password to one specific application?

    Oh, wait a minute..... let me guess.... when your application is running there is special paper (size or forms) required in the printer?

    I think if your application tells the printer that this print job requires forms (there's some kind of API setting available to do that), anyone else trying to use that printer will be prompted to load the other form if your forms are currently loaded.

    This approach might be worth a look.

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      There is no need for a special form, but i think it may be worth to take a look at that.

      The only reason to do this, is because owner wants to prevent people from printing
      personal stuff in office printers. Just the past month he had to refill his toner 3 times,
      and the average pages printed per week was... 40. Numbers doesnt make much sense
      so, he suspects eployees are printing their own stuff in there.

      The password is not for specific application, they want the password also for programs
      like Word or Excell.

      He also needs a count of pages printed and what they contained (Print job name).

      This is a hard task, i havent accepted it yet, im just investigating first.

      Comment


      • #4
        >He also needs a count of pages printed and what they contained (Print job name).

        It wasn't so long ago that someone here had a very similar requirement.

        IIRC I found a couple of APIs which can give you exactly that info... GetJob() and/or EnumPrintJObs() or something like that.

        Not sure how to integrate it into a 'complete and continuous report' but I think there are APIs to handle a lot of the really dirty work.

        MCM
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Bingo....
          Code:
          HANDLE FindFirstPrinterChangeNotification(
            HANDLE hPrinter,              // handle to printer
            DWORD fdwFlags,               // conditions to monitor
            DWORD fdwOptions,             // reserved, must be zero
            LPVOID pPrinterNotifyOptions  // fields to monitor
          FindFirstPrinterChangeNotification
          The FindFirstPrinterChangeNotification function creates a change notification object and returns a handle to the object. You can then use this handle in a call to one of the wait functions to monitor changes to the printer or print server.
          ...
          The FindFirstPrinterChangeNotification call specifies the type of changes to be monitored. You can specify a set of conditions to monitor for changes, a set of printer information fields to monitor, or both.
          ......
          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Thanx Michael, my searches were far off. I think this can help creating a service, controlled in part by my app... Ill play a bit with it.

            Comment


            • #7
              >I think this can help creating a service....

              I will take a copy, thank you.

              I sometimes wonder how much paper I am really using; a utility like this could tell me.

              It would be nice to have a log which keeps track of "pages printed by month," wouldn't it?

              And in the business world, "Who the hell printed 9,875 pages last week?!!!" ("After Hours!!!")

              For that matter, law firms might like such a utility... after all, all law offices have a "meter" on their copy machines, because clients are charged for copies made on their behalf. Seems only reasonable (looking at it from the lawyers' side, that is), to charge for "printer usage," ...too. .. or at least know which clients are eating up your paper and toner and burning out your printers.


              MCM
              Last edited by Michael Mattias; 23 Feb 2008, 08:39 AM.
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                MCM
                A USA company called equitrac has been providing exactly that software to law firms and other heavy printing businesses for years. Having worked with it over the years it seems to most complex part is accurately determining the actual page count for documents printed from various applications (they also do the copier counting you referred to)
                John

                Comment


                • #9
                  seems to most complex part is accurately determining the actual page count for documents printed
                  ???


                  Code:
                  typedef struct _JOB_INFO_2 { 
                    DWORD      JobId; 
                    LPTSTR     pPrinterName; 
                    LPTSTR     pMachineName; 
                    LPTSTR     pUserName; 
                    LPTSTR     pDocument; 
                    LPTSTR     pNotifyName; 
                    LPTSTR     pDatatype; 
                    LPTSTR     pPrintProcessor; 
                    LPTSTR     pParameters; 
                    LPTSTR     pDriverName; 
                    LPDEVMODE  pDevMode; 
                    LPTSTR     pStatus; 
                    PSECURITY_DESCRIPTOR pSecurityDescriptor; 
                    DWORD      Status; 
                    DWORD      Priority; 
                    DWORD      Position; 
                    DWORD      StartTime; 
                    DWORD      UntilTime; 
                  [b]  DWORD      TotalPages; [/b]
                    DWORD      Size; 
                    SYSTEMTIME Submitted; 
                    DWORD      Time; 
                    DWORD      PagesPrinted; 
                  } JOB_INFO_2, *PJOB_INFO_2;
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    Like I said that was in early days, and of course your solution is nice in an orderly world. However my current printer like many others, if it finds that the print exceeds the printable area will insert another page, also I have observed occasions when the printer staus box only shows the size in bytes of the printed document and not the number of pages so I assume the variable you show does not get set.
                    Then again Micheal you may have discovered something Equitrac overlooked with their large programming team of a multi million dollar company. I am sure they would pay handsomely for your solution

                    Comment


                    • #11
                      Oh, I see what you mean... I think....

                      .. The user prints a document with one "windows page" but it's so many lines that the printer does automatic form feeds? Resulting in a "one page document" eating ten sheets of paper?

                      Hmm, that's an interesting challenge...

                      (maybe can disable automatic form feeds? the user gets the first sheet only...of course this assumes that all your office software which prints is not relying on automatic form feeds) (??)

                      MCM
                      Michael Mattias
                      Tal Systems (retired)
                      Port Washington WI USA
                      [email protected]
                      http://www.talsystems.com

                      Comment

                      Working...
                      X