This is a very simple code that uses the GetPrinter API function with Level parameter set to 2. The default printer name is retrieved from Windows Registry. For Windows NT/XP you can use the GetDefaultPrinter function instead.
To run this code for another printer, not the default one, assign its name to lcPrinter variable.
More detailed information about the printer queue is returned by the EnumJobs function. It includes MachineName, UserName, Document, Status, SysTime, PagesPrinter and other parameters.