home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / include / outputsetup.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-11  |  2.0 KB  |  66 lines

  1. #pragma once
  2.  
  3. //-----------------------------------------------------------------------------------//
  4. //              Windows Graphics Programming: Win32 GDI and DirectDraw               //
  5. //                             ISBN  0-13-086985-6                                   //
  6. //                                                                                   //
  7. //  Written            by  Yuan, Feng                             www.fengyuan.com   //
  8. //  Copyright (c) 2000 by  Hewlett-Packard Company                www.hp.com         //
  9. //  Published          by  Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com      //
  10. //                                                                                   //
  11. //  FileName   : outputsetup.h                                                         //
  12. //  Description: Printer setup and page setup wrapper                                //
  13. //  Version    : 1.00.000, May 31, 2000                                              //
  14. //-----------------------------------------------------------------------------------//
  15.  
  16. class KOutputSetup
  17. {
  18.     PRINTDLG     m_pd;
  19.     PAGESETUPDLG m_psd;
  20.  
  21.     void Release(void);
  22.  
  23. public:
  24.     KOutputSetup(void);
  25.     ~KOutputSetup(void);
  26.  
  27.     void DeletePrinterDC(void);
  28.     void SetDefault(HWND hwndOwner, int minpage, int maxpage);
  29.     int  PrintDialog(DWORD flag);
  30.     BOOL PageSetup(DWORD flag);
  31.  
  32.     void GetPaperSize(POINT & p) const
  33.     {
  34.         p = m_psd.ptPaperSize;
  35.     }
  36.  
  37.     void GetMargin(RECT & rect) const
  38.     {
  39.         rect = m_psd.rtMargin;
  40.     }
  41.  
  42.     void GetMinMargin(RECT & rect) const
  43.     {
  44.         rect = m_psd.rtMinMargin;
  45.     }
  46.  
  47.     HDC GetPrinterDC(void) const
  48.     {
  49.         return m_pd.hDC;
  50.     }
  51.  
  52.     DEVMODE * GetDevMode(void)
  53.     {
  54.         return (DEVMODE *) GlobalLock(m_pd.hDevMode);
  55.     }
  56.  
  57.     const TCHAR * GetDriverName(void) const;
  58.     const TCHAR * GetDeviceName(void) const;
  59.     const TCHAR * GetOutputName(void) const;
  60.  
  61.     HDC CreatePrinterDC(void);
  62. };
  63.  
  64. void ShowProperty(KOutputSetup & setup, HINSTANCE hInst, int nControlId[], int dialogres);
  65.  
  66. void ListPrinters(HWND hWnd, int mess = LB_ADDSTRING);