Solved

Icons and saved files in MDI application

Posted on 1997-09-08
4
133 Views
Last Modified: 2008-03-06
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.
0
Comment
Question by:chatten
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 100 total points
ID: 1434275
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
 

Author Comment

by:chatten
ID: 1434276
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
 
LVL 9

Expert Comment

by:cymbolic
ID: 1434277
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
 

Author Comment

by:chatten
ID: 1434278
I see what you mean!

Thanks for the advice.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question