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.

164 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1995.
  5. //
  6. // File: xicon.cxx
  7. //
  8. // Contents: Implementation of CSharesEI & CSharesEIA, implementations
  9. // of IExtractIcon
  10. //
  11. // History: 14-Dec-95 BruceFo Created
  12. //
  13. //----------------------------------------------------------------------------
  14. #include "headers.hxx"
  15. #pragma hdrstop
  16. #include "xicon.hxx"
  17. #include "resource.h"
  18. #include "shares.h"
  19. STDMETHODIMP
  20. CSharesEI::GetIconLocation(
  21. UINT uFlags,
  22. LPTSTR szIconFile,
  23. UINT cchMax,
  24. int* piIndex,
  25. UINT* pwFlags)
  26. {
  27. if (uFlags & GIL_OPENICON)
  28. {
  29. return S_FALSE;
  30. }
  31. lstrcpy(szIconFile, TEXT("shareui.dll"));
  32. WORD wIcon = 0;
  33. switch (m_bFlags)
  34. {
  35. case SHID_SHARE_1:
  36. case SHID_SHARE_2:
  37. if ((m_dwType & ~STYPE_SPECIAL) == STYPE_IPC)
  38. {
  39. wIcon = IDI_IPC;
  40. }
  41. else
  42. {
  43. wIcon = IDI_SHARE;
  44. }
  45. break;
  46. #ifdef WIZARDS
  47. case SHID_SHARE_NW:
  48. wIcon = IDI_NWSHARE;
  49. break;
  50. case SHID_SHARE_MAC:
  51. wIcon = IDI_MACSHARE;
  52. break;
  53. case SHID_SHARE_ALL:
  54. wIcon = IDI_ALLSHARE;
  55. break;
  56. case SHID_SHARE_NEW:
  57. wIcon = IDI_NEWSHARE;
  58. break;
  59. #endif // WIZARDS
  60. default: appAssert(!"Unknown share type");
  61. }
  62. *piIndex = -(int)wIcon;
  63. *pwFlags = GIL_PERINSTANCE;
  64. return S_OK;
  65. }
  66. STDMETHODIMP
  67. CSharesEI::Extract(
  68. LPCTSTR pszFile,
  69. UINT nIconIndex,
  70. HICON* phiconLarge,
  71. HICON* phiconSmall,
  72. UINT nIconSize
  73. )
  74. {
  75. return S_FALSE;
  76. }
  77. #ifdef UNICODE
  78. STDMETHODIMP
  79. CSharesEIA::GetIconLocation(
  80. UINT uFlags,
  81. LPSTR szIconFile,
  82. UINT cchMax,
  83. int* piIndex,
  84. UINT* pwFlags
  85. )
  86. {
  87. if (uFlags & GIL_OPENICON)
  88. {
  89. return S_FALSE;
  90. }
  91. lstrcpyA(szIconFile, "shareui.dll");
  92. WORD wIcon = 0;
  93. switch (m_bFlags)
  94. {
  95. case SHID_SHARE_1:
  96. case SHID_SHARE_2:
  97. if ((m_dwType & ~STYPE_SPECIAL) == STYPE_IPC)
  98. {
  99. wIcon = IDI_IPC;
  100. }
  101. else
  102. {
  103. wIcon = IDI_SHARE;
  104. }
  105. break;
  106. #ifdef WIZARDS
  107. case SHID_SHARE_NW:
  108. wIcon = IDI_NWSHARE;
  109. break;
  110. case SHID_SHARE_MAC:
  111. wIcon = IDI_MACSHARE;
  112. break;
  113. case SHID_SHARE_ALL:
  114. wIcon = IDI_ALLSHARE;
  115. break;
  116. case SHID_SHARE_NEW:
  117. wIcon = IDI_NEWSHARE;
  118. break;
  119. #endif // WIZARDS
  120. default: appAssert(!"Unknown share type");
  121. }
  122. *piIndex = -(int)wIcon;
  123. *pwFlags = GIL_PERINSTANCE;
  124. return S_OK;
  125. }
  126. STDMETHODIMP
  127. CSharesEIA::Extract(
  128. LPCSTR pszFile,
  129. UINT nIconIndex,
  130. HICON* phiconLarge,
  131. HICON* phiconSmall,
  132. UINT nIconSize)
  133. {
  134. return S_FALSE;
  135. }
  136. #endif // UNICODE