home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / Chapt_17 / PrinterDevice / PrinterDevice.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-24  |  1.9 KB  |  68 lines

  1. //-----------------------------------------------------------------------------------//
  2. //              Windows Graphics Programming: Win32 GDI and DirectDraw               //
  3. //                             ISBN  0-13-086985-6                                   //
  4. //                                                                                   //
  5. //  Written            by  Yuan, Feng                             www.fengyuan.com   //
  6. //  Copyright (c) 2000 by  Hewlett-Packard Company                www.hp.com         //
  7. //  Published          by  Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com      //
  8. //                                                                                   //
  9. //  FileName   : printerdevice.cpp                                                     //
  10. //  Description: Printer device context demo program, Chapter 17                     //
  11. //  Version    : 1.00.000, May 31, 2000                                              //
  12. //-----------------------------------------------------------------------------------//
  13.  
  14. #define STRICT
  15. #define NOCRYPT
  16.  
  17. #include <windows.h>
  18. #include <tchar.h>
  19. #include "resource.h"
  20.  
  21. #include "..\\..\\include\\property.h"
  22. #include "..\\..\\include\\listview.h"
  23.  
  24. #include "DevPage.h"
  25.  
  26. class KMain : public KPropertySheet
  27. {
  28.     KDevicePage * m_Device;
  29.  
  30. public: 
  31.  
  32.     KMain(void)
  33.     {
  34.         m_Device = NULL;
  35.     }
  36.  
  37.     ~KMain(void)
  38.     {
  39.         if ( m_Device )
  40.         {
  41.             delete m_Device;
  42.             m_Device = NULL;
  43.         }
  44.     }
  45.  
  46.     void Run(HINSTANCE hInst)
  47.     {
  48.         HPROPSHEETPAGE hPage[3];
  49.  
  50.         m_Device = new KDevicePage(hInst);
  51.         hPage[0] = m_Device->createPropertySheetPage(hInst, IDD_DEVICEPAGE);
  52.  
  53.         propertySheet(hInst, NULL, IDI_PRINT, 1, hPage, "Printer Device");
  54.     }
  55. };
  56.  
  57.  
  58. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
  59. {
  60.     KMain    main;
  61.     
  62.     InitCommonControls();
  63.  
  64.     main.Run(hInstance);
  65.  
  66.     return TRUE;
  67. }    
  68.