WIN API & C#

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
 
M

Morten Wennevik

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top