iconhdlr.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  19. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  20. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  21. // PARTICULAR PURPOSE.
  22. //
  23. // Copyright (C) 1993-1997 Microsoft Corporation. All Rights Reserved.
  24. //
  25. // Modudule: ICONHDLR.CPP
  26. //
  27. // Purpose: Implements the IExtractIcon and IPersistFile member
  28. // functions necessary to support the icon handler portion
  29. // of this shell extension.
  30. //
  31. #include "Stdafx.h"
  32. #include "priv.h"
  33. #include "shellext.h"
  34. extern HINSTANCE g_DllInstance; // Handle to this DLL itself.
  35. // *********************** IExtractIcon Implementation *************************
  36. STDMETHODIMP CShellExt::GetIconLocation(UINT uFlags,
  37. LPSTR szIconFile,
  38. UINT cchMax,
  39. int *piIndex,
  40. UINT *pwFlags)
  41. {
  42. GetModuleFileName(g_DllInstance, szIconFile, cchMax);
  43. *piIndex = (int)GetPrivateProfileInt("IconImage", "Index", 0, m_szFileUserClickedOn);
  44. return S_OK;
  45. }
  46. STDMETHODIMP CShellExt::Extract(LPCSTR pszFile,UINT nIconIndex,HICON *phiconLarge,HICON *phiconSmall,UINT nIconSize)
  47. {
  48. return S_FALSE;
  49. }
  50. // *********************** IPersistFile Implementation ******************
  51. STDMETHODIMP CShellExt::GetClassID(LPCLSID lpClassID)
  52. {
  53. return E_FAIL;
  54. }
  55. STDMETHODIMP CShellExt::IsDirty()
  56. {
  57. return S_FALSE;
  58. }
  59. STDMETHODIMP CShellExt::Load(LPCOLESTR lpszFileName, DWORD grfMode)
  60. {
  61. WideCharToMultiByte(CP_ACP,0,lpszFileName,-1,m_szFileUserClickedOn, sizeof(m_szFileUserClickedOn), NULL,NULL);
  62. return NOERROR;
  63. }
  64. STDMETHODIMP CShellExt::Save(LPCOLESTR lpszFileName, BOOL fRemember)
  65. {
  66. ODS("CShellExt::Save()\r\n");
  67. return E_FAIL;
  68. }
  69. STDMETHODIMP CShellExt::SaveCompleted(LPCOLESTR lpszFileName)
  70. {
  71. ODS("CShellExt::SaveCompleted()\r\n");
  72. return E_FAIL;
  73. }
  74. STDMETHODIMP CShellExt::GetCurFile(LPOLESTR FAR* lplpszFileName)
  75. {
  76. ODS("CShellExt::GetCurFile()\r\n");
  77. return E_FAIL;
  78. }