home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / Chapt_04 / Pogy / ApiPage.cpp next >
Encoding:
C/C++ Source or Header  |  2000-05-11  |  2.6 KB  |  76 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   : apipage.cpp                                                         //
  10. //  Description: KApiPage class                                                      //
  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. #include <tchar.h>
  21.  
  22. #include "..\..\include\win.h"
  23. #include "..\..\include\listview.h"
  24. #include "..\..\include\property.h"
  25.  
  26. #include "..\Diver\Report.h"
  27.  
  28. #include "Resource.h"
  29. #include "ApiTable.h"
  30. #include "ApiPage.h"
  31.  
  32.  
  33. KApiTable ApiTable;
  34.  
  35.  
  36. BOOL KApiPage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  37. {
  38.     switch (uMsg)
  39.     {
  40.         case WM_INITDIALOG:
  41.             m_hWnd    = hWnd;
  42.  
  43.             List.FromDlgItem(hWnd, IDC_LIST);
  44.                 
  45.             List.AddIcon(LVSIL_SMALL,  hInst, IDI_API);
  46.             List.AddIcon(LVSIL_SMALL,  hInst, IDI_COM);
  47.             List.AddIcon(LVSIL_SMALL,  hInst, IDI_SYSCALL);
  48.  
  49.             List.AddColumn(0,  80, _T("Class"));
  50.             List.AddColumn(1,  80, _T("Interface"));
  51.             List.AddColumn(2, 200, _T("Function"));
  52.             List.AddColumn(3,  80, _T("SysCall"));
  53.  
  54.             if (ApiTable.AddTargets(hInst, GetDlgItem(hWnd, IDC_TARGET)) )
  55.             {
  56.                 SendDlgItemMessage(hWnd, IDC_TARGET, CB_SETCURSEL, 0, 0);
  57.                 ApiTable.Add2ListView(List);
  58.             }
  59.                                 
  60.             return TRUE;
  61.  
  62.         case WM_COMMAND:
  63.             if ( wParam==MAKEWPARAM(IDC_TARGET, CBN_SELCHANGE) )
  64.             {
  65.                 if (ApiTable.Initialize(hInst, SendDlgItemMessage(hWnd, IDC_TARGET, CB_GETCURSEL, 0, 0)))
  66.                     ApiTable.Add2ListView(List);
  67.  
  68.                 return TRUE;
  69.             }
  70.     }
  71.         
  72.     return FALSE;
  73. }
  74.  
  75.  
  76.