|
// EnumPrinters.h: interface for the CEnumPrinters class.
//
// Written By : R.I.Allen
// 3rd May 2002
// Roger.Allen@sirius-analytical.com
// You can use this source as you like, but without any warranties of any kind!
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ENUMPRINTERS_H__496315A4_5B64_11D6_AD8C_00B0D0652E95__INCLUDED_)
#define AFX_ENUMPRINTERS_H__496315A4_5B64_11D6_AD8C_00B0D0652E95__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CEnumPrinters
{
public:
CEnumPrinters();
virtual ~CEnumPrinters();
// returning gathered printer information
int GetPrinterCount();
CString GetPrinterName(int index);
CString GetPrinterLocation(int index);
CString GetPrinterShareName(int index);
CString GetPrinterPortName(int index);
// enumerating printers on this and remote machines
void ReadLocalPrinters();
// actually changing or configuring the printer
bool SetNewPrinter(const CString& PrinterName, const CString& PrinterSpooler, const CString& PrinterPort);
bool SetNewPrinter(int index);
bool SetPrintOrientation(HANDLE &hDevMode, int mode);
int GetPrintOrientation(HANDLE &hDevMode);
// saving settings too/from the registry
bool SavePrinterSelection(HANDLE &hDevMode, HANDLE& hDevNames);
bool RestorePrinterSelection(HANDLE &hDevMode, HANDLE& hDevNames);
// debug options only
#ifdef _DEBUG
void DumpHandles(HANDLE& hDevMode, HANDLE& hDevNames);
#endif
private:
int m_NumPrinters;
CStringList m_PrinterName;
CStringList m_PrinterLocation;
CStringList m_PrinterShareName;
CStringList m_PrinterPort;
};
#endif // !defined(AFX_ENUMPRINTERS_H__496315A4_5B64_11D6_AD8C_00B0D0652E95__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
A research and development programmer working for a pharmaceutical instrument company for the past 17 years.
I am one of those lucky people who enjoys his work and spends more time than he should either doing work or reseaching new stuff. I can also be found on playing DDO on the Cannith server (Send a tell to "Maetrim" who is my current main)
I am also a keep fit fanatic, doing cross country running and am seriously into [url]http://www.ryushinkan.co.uk/[/url] Karate at this time of my life, training from 4-6 times a week and recently achieved my 1st Dan after 6 years.