Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
3.9 KiB

  1. /*++
  2. (c) 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. About.cpp
  5. Abstract:
  6. This component implements the ISnapinAbout
  7. interface for the Remote Storage Snapin.
  8. Author:
  9. Art Bragg [abragg] 04-Aug-1997
  10. Revision History:
  11. --*/
  12. #include "stdafx.h"
  13. #include <NtVerP.h>
  14. #include "RsBuild.h"
  15. #include "About.h"
  16. /////////////////////////////////////////////////////////////////////////////
  17. //
  18. ///////////////////////////////////////////////////////////////////////
  19. // ISnapinAbout
  20. ///////////////////////////////////////////////////////////////////////
  21. HRESULT CAbout::AboutHelper(UINT nID, LPOLESTR* lpPtr)
  22. {
  23. WsbTraceIn( L"CAbout::AboutHelper", L"lpPtr = <0x%p>", lpPtr );
  24. HRESULT hr = S_OK;
  25. try {
  26. WsbAffirmPointer( lpPtr );
  27. CWsbStringPtr s;
  28. s.LoadFromRsc( _Module.m_hInst, nID );
  29. *lpPtr = 0;
  30. WsbAffirmHr( s.CopyTo( lpPtr ) );
  31. } WsbCatch( hr );
  32. WsbTraceOut( L"CAbout::AboutHelper", L"hr = <%ls>, *lpPtr = <%ls>", WsbHrAsString( hr ), WsbPtrToStringAsString( lpPtr ) );
  33. return( hr );
  34. }
  35. STDMETHODIMP CAbout::GetSnapinDescription(LPOLESTR* lpDescription)
  36. {
  37. WsbTraceIn( L"CAbout::GetSnapinDescription", L"lpDescription = <0x%p>", lpDescription );
  38. HRESULT hr = AboutHelper(IDS_DESCRIPTION, lpDescription);
  39. WsbTraceOut( L"CAbout::GetSnapinDescription", L"hr = <%ls>, *lpDescription = <%ls>", WsbHrAsString( hr ), WsbPtrToStringAsString( lpDescription ) );
  40. return( hr );
  41. }
  42. STDMETHODIMP CAbout::GetProvider(LPOLESTR* lpName)
  43. {
  44. WsbTraceIn( L"CAbout::GetProvider", L"lpName = <0x%p>", lpName );
  45. HRESULT hr = AboutHelper(IDS_COMPANY, lpName);
  46. WsbTraceOut( L"CAbout::GetProvider", L"hr = <%ls>, *lpName = <%ls>", WsbHrAsString( hr ), WsbPtrToStringAsString( lpName ) );
  47. return( hr );
  48. }
  49. STDMETHODIMP CAbout::GetSnapinVersion(LPOLESTR* lpVersion)
  50. {
  51. WsbTraceIn( L"CAbout::GetSnapinVersion", L"lpVersion = <0x%p>", lpVersion );
  52. HRESULT hr = S_OK;
  53. try {
  54. *lpVersion = 0;
  55. CWsbStringPtr s;
  56. s.Alloc( 100 );
  57. swprintf( s, L"%hs.%d [%ls]", VER_PRODUCTVERSION_STRING, VER_PRODUCTBUILD, RS_BUILD_VERSION_STRING );
  58. WsbAffirmHr( s.CopyTo( lpVersion ) );
  59. } WsbCatch( hr );
  60. WsbTraceOut( L"CAbout::GetSnapinVersion", L"hr = <%ls>, *lpVersion = <%ls>", WsbHrAsString( hr ), WsbPtrToStringAsString( lpVersion ) );
  61. return( hr );
  62. }
  63. STDMETHODIMP CAbout::GetSnapinImage(HICON* hAppIcon)
  64. {
  65. WsbTraceIn( L"CAbout::GetSnapinImage", L"hAppIcon = <0x%p>", hAppIcon );
  66. AFX_MANAGE_STATE( AfxGetStaticModuleState());
  67. HRESULT hr = S_OK;
  68. try {
  69. WsbAffirmPointer( hAppIcon )
  70. *hAppIcon = LoadIcon( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDI_BLUESAKKARA ) );
  71. WsbAffirmPointer( *hAppIcon );
  72. } WsbCatch( hr );
  73. WsbTraceOut( L"CAbout::GetSnapinImage", L"hr = <%ls>, *lpVersion = <%ls>", WsbHrAsString( hr ), WsbPtrToPtrAsString( (void**)hAppIcon ) );
  74. return( hr );
  75. }
  76. STDMETHODIMP
  77. CAbout::GetStaticFolderImage(
  78. HBITMAP* hSmallImage,
  79. HBITMAP* hSmallImageOpen,
  80. HBITMAP* hLargeImage,
  81. COLORREF* cLargeMask
  82. )
  83. {
  84. WsbTraceIn( L"CAbout::GetStaticFolderImage", L"" );
  85. AFX_MANAGE_STATE( AfxGetStaticModuleState());
  86. HRESULT hr = S_OK;
  87. try {
  88. *hSmallImage = LoadBitmap( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDB_SMALL_SAKKARA ) );
  89. WsbAffirmStatus( 0 != *hSmallImage );
  90. *hSmallImageOpen = LoadBitmap( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDB_SMALL_SAKKARA ) );
  91. WsbAffirmStatus( 0 != *hSmallImageOpen );
  92. *hLargeImage = LoadBitmap( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDB_LARGE_SAKKARA ) );
  93. WsbAffirmStatus( 0 != *hLargeImage );
  94. *cLargeMask = RGB( 0xFF, 0x00, 0xFF ); // Magenta
  95. } WsbCatch( hr );
  96. WsbTraceOut( L"CAbout::GetStaticFolderImage", L"hr = <%ls>", WsbHrAsString( hr ) );
  97. return( hr );
  98. }