1.设置打印机纸张以及横打竖打函数
void SetPaper(short paperSize, BOOL bPrintType)
{
PRINTDLG pd;
pd.lStructSize = (DWORD) sizeof(PRINTDLG);
if (GetPrinterDeviceDefaults(&pd))
{
// Lock memory handle.
DEVMODE FAR* pDevMode =
(DEVMODE FAR*)::GlobalLock(m_hDevMode);
LPDEVNAMES lpDevNames;
LPTSTR lpszDriverName, lpszDeviceName, lpszPortName;
HANDLE hPrinter;
if (pDevMode)
{
// Change printer settings in here.
if (bPrintType)
{
pDevMode->dmOrientation = 1;
}
else
{
pDevMode->dmOrientation = 2;
}
//pDevMode->dmOrientation = 2;
pDevMode->dmPap