Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Windows Forms
  4. how to detect when a user is start printing

how to detect when a user is start printing

Scheduled Pinned Locked Moved Windows Forms
tutorialquestion
14 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    spiritboy
    wrote on last edited by
    #1

    hi , i am going to create a counter app, to count the number of pages the user printed, no matter where to print(for example from office or notepad or paint and... just print!) is there any way? is there any unmannaged code?

    W L D 3 Replies Last reply
    0
    • S spiritboy

      hi , i am going to create a counter app, to count the number of pages the user printed, no matter where to print(for example from office or notepad or paint and... just print!) is there any way? is there any unmannaged code?

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      You could have a look at PrintServer Class[^] and PrintQueue Class[^]

      The need to optimize rises from a bad design.My articles[^]

      S 2 Replies Last reply
      0
      • S spiritboy

        hi , i am going to create a counter app, to count the number of pages the user printed, no matter where to print(for example from office or notepad or paint and... just print!) is there any way? is there any unmannaged code?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Looky, look :)[^]

        I are troll :)

        S 1 Reply Last reply
        0
        • L Lost User

          Looky, look :)[^]

          I are troll :)

          S Offline
          S Offline
          spiritboy
          wrote on last edited by
          #4

          what? :)

          L 1 Reply Last reply
          0
          • W Wendelius

            You could have a look at PrintServer Class[^] and PrintQueue Class[^]

            The need to optimize rises from a bad design.My articles[^]

            S Offline
            S Offline
            spiritboy
            wrote on last edited by
            #5

            but these didn't help me so much, i need sth like (PrintStart event) to handle!

            W 1 Reply Last reply
            0
            • S spiritboy

              but these didn't help me so much, i need sth like (PrintStart event) to handle!

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              They don't have any events, you're right about that. One possibility could be using WMI, but that's not so familiar to me. When I answered I was thinking if you could for example pause the queue and just let those jobs through which you have already recorded.

              The need to optimize rises from a bad design.My articles[^]

              S 1 Reply Last reply
              0
              • W Wendelius

                They don't have any events, you're right about that. One possibility could be using WMI, but that's not so familiar to me. When I answered I was thinking if you could for example pause the queue and just let those jobs through which you have already recorded.

                The need to optimize rises from a bad design.My articles[^]

                S Offline
                S Offline
                spiritboy
                wrote on last edited by
                #7

                I am realy Confused :)

                W 1 Reply Last reply
                0
                • S spiritboy

                  what? :)

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  I think those are the classes.. :)

                  I are troll :)

                  1 Reply Last reply
                  0
                  • S spiritboy

                    I am realy Confused :)

                    W Offline
                    W Offline
                    Wendelius
                    wrote on last edited by
                    #9

                    This may not be the best idea, but since you can pause the queue, you could leave it like that. When a new job is submitted to the queue, you have the time to gather the information from that job and after that you can release it. I don't know if it's possible but if the queue can be configured so that every new job is paused by default, then you could do the release per job. That would be more reliable.

                    The need to optimize rises from a bad design.My articles[^]

                    S 1 Reply Last reply
                    0
                    • W Wendelius

                      This may not be the best idea, but since you can pause the queue, you could leave it like that. When a new job is submitted to the queue, you have the time to gather the information from that job and after that you can release it. I don't know if it's possible but if the queue can be configured so that every new job is paused by default, then you could do the release per job. That would be more reliable.

                      The need to optimize rises from a bad design.My articles[^]

                      S Offline
                      S Offline
                      spiritboy
                      wrote on last edited by
                      #10

                      Ok! i'll give it a try, thanks

                      W 1 Reply Last reply
                      0
                      • W Wendelius

                        You could have a look at PrintServer Class[^] and PrintQueue Class[^]

                        The need to optimize rises from a bad design.My articles[^]

                        S Offline
                        S Offline
                        spiritboy
                        wrote on last edited by
                        #11

                        but due to there is no event to handle, should i run and get the printer queue, in an infinite loop? :omg:

                        W 1 Reply Last reply
                        0
                        • S spiritboy

                          Ok! i'll give it a try, thanks

                          W Offline
                          W Offline
                          Wendelius
                          wrote on last edited by
                          #12

                          No problem, but as I said, this may not be the best way, so don't bang your head against the wall for too long :)

                          The need to optimize rises from a bad design.My articles[^]

                          1 Reply Last reply
                          0
                          • S spiritboy

                            but due to there is no event to handle, should i run and get the printer queue, in an infinite loop? :omg:

                            W Offline
                            W Offline
                            Wendelius
                            wrote on last edited by
                            #13

                            Perhaps you could build a service and use polling?. For example a timer with 1 second interval...

                            The need to optimize rises from a bad design.My articles[^]

                            1 Reply Last reply
                            0
                            • S spiritboy

                              hi , i am going to create a counter app, to count the number of pages the user printed, no matter where to print(for example from office or notepad or paint and... just print!) is there any way? is there any unmannaged code?

                              D Offline
                              D Offline
                              Duncan Edwards Jones
                              wrote on last edited by
                              #14

                              You can monitor the printer as per this article[^]

                              '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups