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.

166 lines
2.9 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. #include <strsafe.h>
  20. STDMETHODIMP
  21. CSharesEI::GetIconLocation(
  22. UINT uFlags,
  23. LPTSTR szIconFile,
  24. UINT cchMax,
  25. int* piIndex,
  26. UINT* pwFlags)
  27. {
  28. if (uFlags & GIL_OPENICON)
  29. {
  30. return S_FALSE;
  31. }
  32. StringCchCopy(szIconFile, cchMax, TEXT("shareui.dll"));
  33. WORD wIcon = 0;
  34. switch (m_bFlags)
  35. {
  36. case SHID_SHARE_1:
  37. case SHID_SHARE_2:
  38. if ((m_dwType & ~STYPE_SPECIAL) == STYPE_IPC)
  39. {
  40. wIcon = IDI_IPC;
  41. }
  42. else
  43. {
  44. wIcon = IDI_SHARE;
  45. }
  46. break;
  47. #ifdef WIZARDS
  48. case SHID_SHARE_NW:
  49. wIcon = IDI_NWSHARE;
  50. break;
  51. case SHID_SHARE_MAC:
  52. wIcon = IDI_MACSHARE;
  53. break;
  54. case SHID_SHARE_ALL:
  55. wIcon = IDI_ALLSHARE;
  56. break;
  57. case SHID_SHARE_NEW:
  58. wIcon = IDI_NEWSHARE;
  59. break;
  60. #endif // WIZARDS
  61. default: appAssert(!"Unknown share type");
  62. }
  63. *piIndex = -(int)wIcon;
  64. *pwFlags = GIL_PERINSTANCE;
  65. return S_OK;
  66. }
  67. STDMETHODIMP
  68. CSharesEI::Extract(
  69. LPCTSTR pszFile,
  70. UINT nIconIndex,
  71. HICON* phiconLarge,
  72. HICON* phiconSmall,
  73. UINT nIconSize
  74. )
  75. {
  76. return S_FALSE;
  77. }
  78. #ifdef UNICODE
  79. STDMETHODIMP
  80. CSharesEIA::GetIconLocation(
  81. UINT uFlags,
  82. LPSTR szIconFile,
  83. UINT cchMax,
  84. int* piIndex,
  85. UINT* pwFlags
  86. )
  87. {
  88. if (uFlags & GIL_OPENICON)
  89. {
  90. return S_FALSE;
  91. }
  92. StringCchCopyA(szIconFile, cchMax, "shareui.dll");
  93. WORD wIcon = 0;
  94. switch (m_bFlags)
  95. {
  96. case SHID_SHARE_1:
  97. case SHID_SHARE_2:
  98. if ((m_dwType & ~STYPE_SPECIAL) == STYPE_IPC)
  99. {
  100. wIcon = IDI_IPC;
  101. }
  102. else
  103. {
  104. wIcon = IDI_SHARE;
  105. }
  106. break;
  107. #ifdef WIZARDS
  108. case SHID_SHARE_NW:
  109. wIcon = IDI_NWSHARE;
  110. break;
  111. case SHID_SHARE_MAC:
  112. wIcon = IDI_MACSHARE;
  113. break;
  114. case SHID_SHARE_ALL:
  115. wIcon = IDI_ALLSHARE;
  116. break;
  117. case SHID_SHARE_NEW:
  118. wIcon = IDI_NEWSHARE;
  119. break;
  120. #endif // WIZARDS
  121. default: appAssert(!"Unknown share type");
  122. }
  123. *piIndex = -(int)wIcon;
  124. *pwFlags = GIL_PERINSTANCE;
  125. return S_OK;
  126. }
  127. STDMETHODIMP
  128. CSharesEIA::Extract(
  129. LPCSTR pszFile,
  130. UINT nIconIndex,
  131. HICON* phiconLarge,
  132. HICON* phiconSmall,
  133. UINT nIconSize)
  134. {
  135. return S_FALSE;
  136. }
  137. #endif // UNICODE