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

//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1995 - 1995.
//
// File: xicon.cxx
//
// Contents: Implementation of CSharesEI & CSharesEIA, implementations
// of IExtractIcon
//
// History: 14-Dec-95 BruceFo Created
//
//----------------------------------------------------------------------------
#include "headers.hxx"
#pragma hdrstop
#include "xicon.hxx"
#include "resource.h"
#include "shares.h"
#include <strsafe.h>
STDMETHODIMP
CSharesEI::GetIconLocation(
UINT uFlags,
LPTSTR szIconFile,
UINT cchMax,
int* piIndex,
UINT* pwFlags)
{
if (uFlags & GIL_OPENICON)
{
return S_FALSE;
}
StringCchCopy(szIconFile, cchMax, TEXT("shareui.dll"));
WORD wIcon = 0;
switch (m_bFlags)
{
case SHID_SHARE_1:
case SHID_SHARE_2:
if ((m_dwType & ~STYPE_SPECIAL) == STYPE_IPC)
{
wIcon = IDI_IPC;
}
else
{
wIcon = IDI_SHARE;
}
break;
#ifdef WIZARDS
case SHID_SHARE_NW:
wIcon = IDI_NWSHARE;
break;
case SHID_SHARE_MAC:
wIcon = IDI_MACSHARE;
break;
case SHID_SHARE_ALL:
wIcon = IDI_ALLSHARE;
break;
case SHID_SHARE_NEW:
wIcon = IDI_NEWSHARE;
break;
#endif // WIZARDS
default: appAssert(!"Unknown share type");
}
*piIndex = -(int)wIcon;
*pwFlags = GIL_PERINSTANCE;
return S_OK;
}
STDMETHODIMP
CSharesEI::Extract(
LPCTSTR pszFile,
UINT nIconIndex,
HICON* phiconLarge,
HICON* phiconSmall,
UINT nIconSize
)
{
return S_FALSE;
}
#ifdef UNICODE
STDMETHODIMP
CSharesEIA::GetIconLocation(
UINT uFlags,
LPSTR szIconFile,
UINT cchMax,
int* piIndex,
UINT* pwFlags
)
{
if (uFlags & GIL_OPENICON)
{
return S_FALSE;
}
StringCchCopyA(szIconFile, cchMax, "shareui.dll");
WORD wIcon = 0;
switch (m_bFlags)
{
case SHID_SHARE_1:
case SHID_SHARE_2:
if ((m_dwType & ~STYPE_SPECIAL) == STYPE_IPC)
{
wIcon = IDI_IPC;
}
else
{
wIcon = IDI_SHARE;
}
break;
#ifdef WIZARDS
case SHID_SHARE_NW:
wIcon = IDI_NWSHARE;
break;
case SHID_SHARE_MAC:
wIcon = IDI_MACSHARE;
break;
case SHID_SHARE_ALL:
wIcon = IDI_ALLSHARE;
break;
case SHID_SHARE_NEW:
wIcon = IDI_NEWSHARE;
break;
#endif // WIZARDS
default: appAssert(!"Unknown share type");
}
*piIndex = -(int)wIcon;
*pwFlags = GIL_PERINSTANCE;
return S_OK;
}
STDMETHODIMP
CSharesEIA::Extract(
LPCSTR pszFile,
UINT nIconIndex,
HICON* phiconLarge,
HICON* phiconSmall,
UINT nIconSize)
{
return S_FALSE;
}
#endif // UNICODE