Can I show this dialog box << See what's printing>> in c#?
Normally is when you choose the printer and right click on the printer and then choose "See what's printing.".Now I want to show this dialog in my c# program.
If you can help me, please help.
Thanks a lot .

Asp.Net HeinPosted Apr 30, 2015, 3:00 AM
Another solution for me?
Asp.Net HeinPosted Apr 30, 2015, 1:10 AM
But how I get the printer name??Can you help me again?
Manoj BhoirPosted Apr 30, 2015, 12:59 AM
You can use the .NET 3.0 PrintQueue class in the System.Printing namespace. Its NumberOfJobs property tells you how many jobs are queued, GetPrintJobInfoCollection() returns details on all the jobs. Beware that it doesn't have any events that tells you that the job collection changed, you need to poll with a timer.
private int GetNumberOfPrintJobs()
{
LocalPrintServer server = new LocalPrintServer();
PrintQueueCollection queueCollection = server.GetPrintQueues();
PrintQueue printQueue = null;
foreach (PrintQueue pq in queueCollection)
{
if (pq.FullName == PrinterName)
printQueue = pq;
}
int numberOfJobs = 0;
if (printQueue != null)
numberOfJobs = printQueue.NumberOfJobs;
return numberOfJobs;
}
Or
public static void WritePrinterJobs()
{
while (true)
{
foreach (var job in LocalPrintServer.GetDefaultPrintQueue().GetPrintJobInfoCollection())
{
Console.WriteLine(job.Submitter + " " + job.TimeJobSubmitted.ToShortDateString());
}
Thread.Sleep(100);
}
}