Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Icons and saved files in MDI application

Posted on 1997-09-08
4
Medium Priority
?
136 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 200 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

610 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