Solved

Icons and saved files in MDI application

Posted on 1997-09-08
4
125 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now