Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating proprietary files with Office like File/Propert
Message
 
 
To
30/11/2001 15:14:34
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00588210
Message ID:
00588315
Views:
20
This message has been marked as the solution to the initial question of the thread.
Hi Malcolm,

The following article discusses those WIN2K UI enhancements in details http://msdn.microsoft.com/msdnmag/issues/0300/w2kui/w2kui.asp

>Our software stores its data in a proprietary file format. We are looking for a way to add a header to our proprietary data files so that our files have MS Office like file properties, i.e. the file properties that show up when you right click a file in Explorer or that get displayed in a tooltip type window in Windows 2000 when you hover your mouse over a file.
>
>Windows displays these properties if they're present and non-blank:
>- Type
>- Author
>- Title
>
>Other commonly exposed MS Office type file properties:
>- Subject
>- Company
>- Category
>- Keywords
>- Comments
>- Hyperlink base
>- Template
>
>Here are some ideas I have on how me might accomplish this. Your ideas and feedback appreciated!
>
>1. My guess(?) is that MS Office files expose their properties because they use Window's OLE storage system. Would it be possible to create a one char long Word document and use this file as a file header template to which we would append our data to the end. Given a legal file header, we could then use OLE API calls to change the value's of the Word header to match the content appended to the end of this header.
>
>I experimented by taking an empty Word document with property settings and renaming this file with another extension. Even after renaming the file's extension, all its properties were still visible to the Windows shell. The only thing that changed was the file's 'type' which corresponded to it's new file extension.
>
>2. Using the same '(ill)logic' as above, compile an 'empty' VFP EXE so we can fill in the EXE's file properties (title, version, copyright, etc.). This empty EXE file would serve as our file's header. We would then append our data to the end of this EXE header. Or is it possible to create a generic EXE (or other file extension type) header and then call specific API functions to update it's file properties? How do compilers embed this type of information into an executable? Could we just pad our file properties with a special filler character and then 'poke' in replacement characters (bypassing the Windows API). Yes, I know that's an UGLY technique - but it sounds like a technique none-the-less.
>
>Any feedback GREATFULLY appreciated!
>
>Malcolm
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform