Display custom images

B

Bala Nagarajan

Hello,
I am developing a tool (in Windows Forms .NET 1.1) which uses a
OpenFileDialog component to browse file in the local hard drive. I want to
be able to show some folders in the OpenFileDialog with a different image.
These folders are unique to the tool and has a defined folder structure. For
example the structure of the tool folder may be something like this
ToolFolder\ScriptsFile. So when the OpenFileDialog identies any folder with
this structure (ToolFolder\ScriptsFile) it should display the folder icon to
a custom icon rather the default windows folder icon.

All i want to do is look at the directories displayed in the OpenFileDialog
and check if they have a predefined structure. If yes display that folder
with a custom image.

Is it possible to do this?

Any help will be apperciated.

Thanks
Bala
 
L

Linda Liu [MSFT]

Hi Bala,

Thank you for posting.

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.


Sincerely,
Linda Liu
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.
====================================================
 
B

Bala Nagarajan

Hi Linda,
Thanks for the effort. Awaiting your reply.

Thanks and i apperciate your help.

Bala
 
L

Linda Liu [MSFT]

Hi Bala,

There are a few ways to do that.

1) You can put a desktop.ini file in the directory that specifies the
icon to use. This is covered here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/shell/programmersguide/shell_basics/shell_basics_extending/custom.asp

2) You can also put a desktop.ini in the directory that specifies the
IShellFolder implementation to use. Add a CLSID to the [.ShellClassInfo]
section that points to your CLSID that implements IShellFolder.

3) You could attempt some elaborate hacks and subclassing to try to make
this work. This method will probably break with each new release of Windows.

Note that either the first method or the second method will affect Windows
in general since you are setting the icon for the shell. So browsing to
these folders in Windows Explorer or File | Open in another app will show
your custom icon as well.

Hope this is helpful to you.
If you have any other concerns or need anything else, please don't hesitate
to let me know.


Sincerely,
Linda Liu
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.
====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top