Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Intel Corner

Register Document File Types

Fill and Query the Registry

Issue: 3.1 (September/October 2004)
Author: Christian Schmitz
Author Bio: Christian Schmitz is the creator of the Monkeybread Software REALbasic Plugins.
Article Description: No description available.
Article Length (in bytes): 9,216
Starting Page Number: 42
RBD Number: 3120
Resource File(s):

Download Icon 3120.sit Updated: Wednesday, September 15, 2004 at 4:28 PM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

What do we want to do?

The first part of this article will show you how to add your own document file types to the Windows Registry, so your document icon shows in Windows Explorer windows and your application is launched whenever such a file is double-clicked.

The second part describes the opposite process: we query the Registry for the location of a given file type's application. This way you can test, for example, whether or not the Adobe Acrobat Reader is installed.

Register a file type

First, we need a FolderItem for our own application file. In REALbasic 5.5, you can use the ExecutableFile method of the application class. On earlier versions, you can use a plugin function (e.g., app.ApplicationFileMBS) or your own declare-based function.

dim appfile as folderitem

appfile=app.ExecutableFile

When you double-click one of your documents, Explorer checks that file's extension. Then, the file extension's name is searched for in the Classes Root of the Registry. This key has the file type string as the default value.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com