Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Mon, 4 Feb 2008 15:41:06 -0800,    group: microsoft.public.platformsdk.shell        back       


IShellIcon::GetIconOf   
The documentation at:

http://msdn2.microsoft.com/en-us/library/bb761275(VS.85).aspx

for IShellIcon::GetIconOf says that I can return 3 or 4 for a folder icon, 
however when I do this on Windows XP using the DefView it doesn't display a 
folder icon.  The flag it is passing in is 0.  

I also have tried this for a appication icon (2) with the DefView, however 
it too doesn't work, shows up as a black dot with an x in it.

Can I use this Interface with the DefView?  I have IExtractIcon interface 
working, however was looking for a faster way to return the icon when they 
are system icons.

-Wayne
{6230289B-5BEE-409e-932A-2F01FA407A92}
date: Mon, 4 Feb 2008 15:41:06 -0800   author:   Wayne Berry am

RE: IShellIcon::GetIconOf   
Hi Wayne,

This is a quick note to let you know that I am performing research on this 
issue and will get back to you as soon as possible. I appreciate your 
patience. 


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
date: Tue, 05 Feb 2008 07:06:34 GMT   author:   (Walter Wang [MSFT])

RE: IShellIcon::GetIconOf   
This is my very simple set of code to Support IShellIcon.

- I can confirm that it is getting called.
- I can confirm that it is returning S_OK when it sets the Icon and S_FALSE 
when it doesn't
- I can confirm that an icon is showing up -- however it is not the right 
icon based on the documentation in MSDN.  Icons show -- they are valid icons, 
however they are not default folders, open folders, and applications.

If need I can provide a screen shot of the icons.  What it appears like is 
that DefView is modifying the system icon list, and using the default icon 
indexs in the MSDN documentation is reference the wrong icons.

-Wayne

STDMETHODIMP CShellFolder::GetIconOf(LPCITEMIDLIST pidl, UINT flags, LPINT 
lpIconIndex)
{
	HRESULT	hrReturn = S_OK;
	BSTR bstrName = NULL;
	LPTSTR szExtension = NULL;

	// WWB: When a client sets the GIL_ASYNC flag in uFlags and receives 
E_PENDING as a return value,
	// it typically creates a background thread to extract the icon.
	if (flags & GIL_ASYNC)
	{
		hrReturn = E_PENDING;
		goto End;
	}

	LPMYPIDLDATA pData = m_pPidlMgr->GetDataPointer(pidl);
	if (!pData)
	{
		// WWB: TODO Handle Error
		hrReturn = E_FAIL;
		goto End;
	}

	switch(pData->pidlType)
	{
	case PT_FILE:

		hrReturn = FileGetName(pData->guid,&bstrName);
		if (FAILED(hrReturn))
		{
			// WWB: TODO Handle Error
			goto End;
		}

		hrReturn = ::GetExtension(bstrName,&szExtension);
		if (FAILED(hrReturn))
		{
			// WWB: TODO Handle Error
			goto End;
		}

		if ((!_tcsicmp(szExtension,_T(".exe"))) ||
			(!_tcsicmp(szExtension,_T(".bat"))) ||
			(!_tcsicmp(szExtension,_T(".com"))))
		{
			*lpIconIndex = 2;
			goto End;
		}

		hrReturn = S_FALSE;

		break;

	case PT_FOLDER:
		switch(flags)
		{
		case 0:
			*lpIconIndex = 3;
			break;
		case GIL_FORSHELL:
			*lpIconIndex = 3;
			break;
		case GIL_OPENICON:
			*lpIconIndex = 4;
			break;
		default:
			hrReturn = S_FALSE;
		}
		break;
	}

End:

	ENDCOMTRACE();

	if (bstrName)
		::SysFreeString(bstrName);

	if (szExtension)
		delete szExtension;

	return(hrReturn);
}
date: Fri, 8 Feb 2008 09:15:00 -0800   author:   Wayne Berry am

RE: IShellIcon::GetIconOf   
Hi Wayne,

Could you please send me a copy of the screenshot?

Thanks.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
date: Tue, 12 Feb 2008 08:08:52 GMT   author:   (Walter Wang [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us