Icons and saved files in MDI application

I'm creating an MDI application, and have an icon for the MDI form and a separate one for its children.  What I want to do, is assign this second icon to the files that are saved within the application i.e. like in Word, where a saved document has the Word child icon associated with it when you look at it in My Computer of Windows Explorer.  Is there a simple way of doing this?

Thanks for any help.

Jon.
chattenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cymbolicCommented:
I'm not sure if I'm addressing your question, but, the icons in windows explorer come not from the file itself, but indirectly from the application that the file type is associated with.  So, if you compile an icon into your program, and if you associate your program with the file types it creates in explorer, then your files will get the icon that your application has compiled in it.

If you are doing your own file displays internally, then you can display your own selected icons by using a control like the Listview control, and setting the icon properties (smallicon, etc) at .additem method time, or at run time by changing icon property settings on each item.

Did I answer some of your question, or did I miss the point entirely?.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chattenAuthor Commented:
I think you've answered it!  Do you mean that if I save a file within my MDI application, like a document saved in Word, then it will automatically be given the icon that I have given to the MDI form if I look at this saved file later with Windows Explorer?
0
cymbolicCommented:
No, it's not that easy.  Have'nt you heard that Windows is the operating system that makes the easy things difficult, and the hard things impossible? :)!

If you want to do both things, that is show same icon for the files in your program and in Windows explorer, you have to work both ends of the street.  For the Explorer, you must compile your application with the Icon you wish to use.  You do that by using the make exe option under file, then selecting the options button on the box, then selecting an icon to be embeded in your app.  Then you have to place a shortcut to your app in the send to folder in windows.  Then you have to associate your filename types to your application in the Windows Explorer.  You do this by double clicking on one of your files, then when explorer asks you to associate it, pick your application out of the send to folder.  Once this is done, all the files of the type you create appear in the explorer with the icon from your application.

The other side of the street is showing the files in your application using the same icon.  You can do this by using a control like the ListVIew control, and specifying the same icon in every .additem method.

Then you have to ask yourself: after all this, is it really worth it?
0
chattenAuthor Commented:
I see what you mean!

Thanks for the advice.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.