home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / include / guires.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-12  |  1.6 KB  |  41 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   : guires.h                                                             //
  12. //  Description: Query USER/GDI resources, Windows 2000                              //
  13. //  Version    : 1.00.000, May 31, 2000                                              //
  14. //-----------------------------------------------------------------------------------//
  15.  
  16. class KGUIResource
  17. {
  18.     int m_gdi, m_user;
  19.  
  20. public:
  21.     KGUIResource()
  22.     {
  23.         m_gdi  = GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS);
  24.         m_user = GetGuiResources(GetCurrentProcess(), GR_USEROBJECTS);
  25.     }
  26.  
  27.     ~KGUIResource()
  28.     {
  29.         int gdi  = GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS);
  30.         int user = GetGuiResources(GetCurrentProcess(), GR_USEROBJECTS);
  31.  
  32.         if ( (m_gdi==gdi) && (m_user==user) )
  33.             return;
  34.         
  35.         char temp[64];
  36.         wsprintf(temp, "ResourceDifference: gdi(%d->%d) user(%d->%d)\n", m_gdi, gdi, m_user, user);
  37.         OutputDebugString(temp);
  38.     }
  39. };
  40.                 
  41.