How to Cancel Print Jobs in Window 7 - via VFP9


All replies

  • First of all, wouldn't it be easy and fair enough to teach your customers using the printer queue of Windows itself to cancel print jobs? 

    You will need the Win API. OpenPrinter, EnumJobs and SetJob still exist.

    But sorry, I don't have the time to fiddle out the structures and code needed. Maybe someone else will help you, if you specify further. Do you want to enumerate all jobs for a user to choose from and cancel? Or do you only want to programmatically find your own print job and cancel it? Because in the seconds case you could perhaps also get the current printjob without going through EnumJobs.

    Bye, Olaf.

    Saturday, December 15, 2012 9:15 AM
  • Yes,

    1. I want to programmatically find my own print job and cancel it.

    2. I want to cancel all print Jobs.

    • Edited by R.a.j.e.s.h Saturday, December 15, 2012 9:50 AM
    Saturday, December 15, 2012 9:49 AM
  • News2news offers the complete code which is worth of the amount requested.

    Of course, it is you who placed the job into the print queue. Think twice before you do it and it will be free...

    BTW, the print queue can be processed before your delete action and switching the printer off or paper removal is the only solution in such a case.

    Saturday, December 15, 2012 6:52 PM
  • Sunday, December 16, 2012 2:56 AM
  • I would like to propose the previous post as an answer but "Unexpected error" always appears...
    Sunday, December 16, 2012 3:26 PM
  • Hi Pavel,

    This is a known bug. See this and the thread referenced in that thread. I've been severely affected by this bug in last 3 months.

    For every expert, there is an equal and opposite expert. - Becker's Law

    My blog

    Sunday, December 16, 2012 4:00 PM
  • Interesting. It does not happen so often to me but your activity is on another level. :-)

    Sunday, December 16, 2012 9:56 PM