home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / Chapt_04 / Pogy / Main.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-30  |  2.1 KB  |  71 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   : main.cpp                                                             //
  10. //  Description: Spy control program main program                                    //
  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.  
  20. #include "..\..\include\win.h"
  21. #include "..\..\include\property.h"
  22.  
  23. #include "Resource.h"
  24. #include "Aplet.h"
  25. #include "Pogy.h"
  26.  
  27.  
  28. class KMain : public KPropertySheet
  29. {
  30.     typedef enum { MAXPAGES = 10 };
  31.  
  32.     HINSTANCE hInstance;
  33.     KAplet   *Pogy;
  34.     HWND      m_hWnd;
  35.  
  36. public:
  37.     
  38.     void Run(HINSTANCE hInst)
  39.     {
  40.         HPROPSHEETPAGE hPage[MAXPAGES];
  41.  
  42.         hInstance = hInst;
  43.     
  44.         Pogy = CreatePogy();
  45.  
  46.         Pogy->InitProcess(hInst);
  47.         Pogy->Initialize(hInstance);
  48.  
  49.         int pn = Pogy->GetPropertySheetPages(hInst, hPage);
  50.         
  51.         propertySheet(hInstance, NULL, IDI_SPY, pn, hPage, "Pogy");
  52.  
  53.         Pogy->TermProcess(hInst);
  54.  
  55.         DeletePogy(Pogy);
  56.     }
  57. };
  58.  
  59.  
  60. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine,    int nCmdShow)
  61. {
  62.     // listview needs it.
  63.     InitCommonControls();
  64.  
  65.     KMain Main;
  66.    
  67.     Main.Run(hInstance);
  68.  
  69.     return TRUE;
  70. }
  71.