WIN API & C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In c# ,
I use wmi to monitor print job but I need to get PrintJob 's number of
copies and wmi don't expose it.
So i think to use win API but I am a newbie of Pinvoke.
This is function declaration:
[DllImport("winspool.drv", EntryPoint="GetJob")] public static extern int
GetJobA
(int hPrinter, int JobId, int Level, ref byte pJob, int cdBuf, ref int
pcbNeeded)

Anyone can help me , any example to use this function?
Thanks in advance
Max
 
Hi Max,

You should take a look at

http://www.pinvoke.net/

I couldn't find an entry for GetJob, but assuming your pJob returns an array of job structures, you can either read the array by hand or use Marshalling for transforming the byte[] -> Job struct

http://www.pinvoke.net/default.aspx/Structures.JOB_INFO_1



In c# ,
I use wmi to monitor print job but I need to get PrintJob 's number of
copies and wmi don't expose it.
So i think to use win API but I am a newbie of Pinvoke.
This is function declaration:
[DllImport("winspool.drv", EntryPoint="GetJob")] public static extern int
GetJobA
(int hPrinter, int JobId, int Level, ref byte pJob, int cdBuf, ref int
pcbNeeded)

Anyone can help me , any example to use this function?
Thanks in advance
Max
 
Back
Top