home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / Chapt_04 / Pogy / Pogy.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-11  |  2.7 KB  |  100 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   : pogy.cpp                                                            //
  10. //  Description: Spy control program PropertySheet                                   //
  11. //  Version    : 1.00.000, May 31, 2000                                              //
  12. //-----------------------------------------------------------------------------------//
  13.  
  14. #define NOCRYPT
  15.  
  16. #include <windows.h>
  17. #include <commctrl.h>
  18. #include <assert.h>
  19. #include <stdio.h>
  20.  
  21. #include "..\..\include\win.h"
  22. #include "..\..\include\listview.h"
  23. #include "..\..\include\property.h"
  24.  
  25. #include "..\Diver\Diver.h"
  26. #include "..\Diver\Report.h"
  27.  
  28. #include "Resource.h"
  29.  
  30. #include "ApiTable.h"
  31. #include "ApiPage.h"
  32. #include "Setup.h"
  33. #include "Event.h"
  34. #include "Aplet.h"
  35.  
  36. #include "Pogy.h"
  37.  
  38.  
  39. class KPogyAplet : public KAplet
  40. {
  41.     KSetupPogyPage   SetupPogyPage;
  42.     KApiPage         ApiPage;
  43.     KEventPage       EventPage;
  44.     
  45. public:
  46.     void InitProcess(HINSTANCE hInstance);
  47.     void TermProcess(HINSTANCE hInstance);
  48.     int  GetPropertySheetPages(HINSTANCE hInst, HPROPSHEETPAGE *hPage);
  49.     void Initialize(HINSTANCE hInst);
  50. };
  51.  
  52.  
  53. void KPogyAplet::InitProcess(HINSTANCE hInstance)
  54. {
  55.     SetupPogyPage.ReadOptions(hInstance);
  56.  
  57.     SetupDiver(Diver_Install, NULL);
  58.     
  59.  
  60. void KPogyAplet::TermProcess(HINSTANCE hInstance)
  61. {
  62.     SetupDiver(Diver_UnInstall, NULL);
  63.  
  64.     SetupPogyPage.SaveOptions(hInstance);
  65. }
  66.     
  67.  
  68. int KPogyAplet::GetPropertySheetPages(HINSTANCE hInst, HPROPSHEETPAGE *hPage)
  69. {
  70.     hPage[0] =     EventPage.createPropertySheetPage(hInst, IDD_EVENT);
  71.     hPage[1] = SetupPogyPage.createPropertySheetPage(hInst, IDD_SETUPPOGY);
  72.     hPage[2] =       ApiPage.createPropertySheetPage(hInst, IDD_API);
  73.     
  74.     return 3;
  75. }
  76.  
  77.  
  78. void KPogyAplet::Initialize(HINSTANCE hInst)
  79. {
  80.     ApiPage.hInst = hInst;
  81.  
  82.     EventPage.Initialize(& SetupPogyPage);
  83.  
  84.     ApiTable.Initialize(hInst, 0);
  85. }
  86.  
  87.  
  88. KAplet *CreatePogy(void)
  89. {
  90.     return new KPogyAplet;
  91. }
  92.  
  93. void DeletePogy(KAplet *aplet)
  94. {
  95.     delete (KPogyAplet *) aplet;
  96. }
  97.  
  98.  
  99.