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. .NET (Core and Framework)
  4. How to detect the person who will click the print option in windows application???

How to detect the person who will click the print option in windows application???

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpdesigntutorialquestion
4 Posts 3 Posters 1 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.
  • M Offline
    M Offline
    manjari kar
    wrote on last edited by
    #1

    Hi, I m manjari.let me tell u the problem while doing my work in my company.when ever a person click the print option to print a document it should detect the person and that time instead of print dialog box our window should display with username and password.if valid then it will goes to print spool.I hv done the program after going to print spool it already detect the person but i want before goin to print spool it should detct.anybody plz help me as soon as possible. thanks, regards, manjari

    How i will design a a form in windows service to print a document.

    C 1 Reply Last reply
    0
    • M manjari kar

      Hi, I m manjari.let me tell u the problem while doing my work in my company.when ever a person click the print option to print a document it should detect the person and that time instead of print dialog box our window should display with username and password.if valid then it will goes to print spool.I hv done the program after going to print spool it already detect the person but i want before goin to print spool it should detct.anybody plz help me as soon as possible. thanks, regards, manjari

      How i will design a a form in windows service to print a document.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      manjari kar wrote:

      when ever a person click the print option to print a document it should detect the person and that time instead of print dialog box our window should display with username and password

      If you want to show a username/password dialog before the print dialog then you should create one and call ShowDialog on the username/password dialog before the PrintDialog.

      manjari kar wrote:

      How i will design a a form in windows service to print a document.

      You cannot. A windows service has no user interface and can run without there being any user logged in.

      Man who stand on hill with mouth open wait long time for roast duck to drop in

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        manjari kar wrote:

        when ever a person click the print option to print a document it should detect the person and that time instead of print dialog box our window should display with username and password

        If you want to show a username/password dialog before the print dialog then you should create one and call ShowDialog on the username/password dialog before the PrintDialog.

        manjari kar wrote:

        How i will design a a form in windows service to print a document.

        You cannot. A windows service has no user interface and can run without there being any user logged in.

        Man who stand on hill with mouth open wait long time for roast duck to drop in

        M Offline
        M Offline
        manjari kar
        wrote on last edited by
        #3

        thanx for responding.plz giv eme ur answer depictly with code .becoz i tried a lot .but i didnt get result.plz help me.and nw again i briefly tell u the task.suppose in ms word or in notepad or in pdf file ,when a person is going to click the print option in file menu thattime our window should display instead of print dialog popup.if valid then it goes to print dialog popup for print that document. i hv done my task like this.after clicking the print option printdialog popup is comming,then clicking ok my window is displaying and asking for username and password.but i want before that print dialog popup it should display.plz helpme and give me a right path. my code is like this : private void timer1_Tick(object sender, EventArgs e) { PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e"); PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); foreach (PrintQueue pq in myPrintQueues) { pq.Refresh(); PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection(); foreach (PrintSystemJobInfo job in jobs) { if (job.Submitter == "gyana.manjarikar") { job.Pause(); } if (true) { //MessageBox.Show(job.Name.ToString()); this.Show(); } else this.Hide(); } } } private void btnlogin_Click(object sender, EventArgs e) { int copies=10; this.Opacity = 50; PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e"); PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); foreach (PrintQueue pq in myPrintQueues) { pq.Refresh(); PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection(); foreach (PrintSystemJobInfo job in jobs) { //if (txtUserName.Text == "aaa" && txtPassword.Text == "bbb" && copies <= 10) //{ // job.Restart(); //} if (job.Submitter == "gyana.manjarikar") { if (txtUserName.Text == "aa" &

        L 1 Reply Last reply
        0
        • M manjari kar

          thanx for responding.plz giv eme ur answer depictly with code .becoz i tried a lot .but i didnt get result.plz help me.and nw again i briefly tell u the task.suppose in ms word or in notepad or in pdf file ,when a person is going to click the print option in file menu thattime our window should display instead of print dialog popup.if valid then it goes to print dialog popup for print that document. i hv done my task like this.after clicking the print option printdialog popup is comming,then clicking ok my window is displaying and asking for username and password.but i want before that print dialog popup it should display.plz helpme and give me a right path. my code is like this : private void timer1_Tick(object sender, EventArgs e) { PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e"); PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); foreach (PrintQueue pq in myPrintQueues) { pq.Refresh(); PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection(); foreach (PrintSystemJobInfo job in jobs) { if (job.Submitter == "gyana.manjarikar") { job.Pause(); } if (true) { //MessageBox.Show(job.Name.ToString()); this.Show(); } else this.Hide(); } } } private void btnlogin_Click(object sender, EventArgs e) { int copies=10; this.Opacity = 50; PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e"); PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); foreach (PrintQueue pq in myPrintQueues) { pq.Refresh(); PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection(); foreach (PrintSystemJobInfo job in jobs) { //if (txtUserName.Text == "aaa" && txtPassword.Text == "bbb" && copies <= 10) //{ // job.Restart(); //} if (job.Submitter == "gyana.manjarikar") { if (txtUserName.Text == "aa" &

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          that is unreadable. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


          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