Leaked source code of windows server 2003
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.

52 lines
1.2 KiB

  1. // stdafx.cpp : source file that includes just the standard includes
  2. // stdafx.pch will be the pre-compiled header
  3. // stdafx.obj will contain the pre-compiled type information
  4. #include "stdafx.h"
  5. #ifdef _ATL_STATIC_REGISTRY
  6. #include <statreg.h>
  7. #include <statreg.cpp>
  8. #endif
  9. #include <atlimpl.cpp>
  10. HRESULT LoadImages(IImageList* pImageList)
  11. {
  12. HRESULT hr = E_FAIL;
  13. if( pImageList )
  14. {
  15. HICON hIcon = (HICON)::LoadImage(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDI_Icon), IMAGE_ICON, 0,0,0);
  16. if( hIcon )
  17. {
  18. hr = pImageList->ImageListSetIcon((LONG_PTR *)hIcon, 0);
  19. }
  20. }
  21. return hr;
  22. }
  23. tstring StrLoadString( UINT uID )
  24. {
  25. tstring strRet = _T("");
  26. HINSTANCE hInst = _Module.GetResourceInstance();
  27. INT iSize = MAX_PATH;
  28. TCHAR* psz = new TCHAR[iSize];
  29. if( !psz ) return strRet;
  30. while( LoadString(hInst, uID, psz, iSize) == (iSize - 1) )
  31. {
  32. iSize += MAX_PATH;
  33. delete[] psz;
  34. psz = NULL;
  35. psz = new TCHAR[iSize];
  36. if( !psz ) return strRet;
  37. }
  38. strRet = psz;
  39. delete[] psz;
  40. return strRet;
  41. }