Contents
Navigation
Home User Reference Other Resources


QuickTime provides a simple mechanism that makes it possible to protect data: access keys. They allow an application that supplies data to register a password for the data with QuickTime and allows a user to enter the password to gain access to the data. For example, a codec can protect data it compresses with a password, so that it is available only to someone with the password. Similarly, the creator of a movie can require a password to view the movie. In order to gain access to protected data, the user enters the access key in the QuickTime Settings control panel. This class allows you either to create new access keys or remove them programmatically.
You can find about the currently registered access keys of the host system by using the appropriate methods and properties of the class.





The QTPlgAccessKey class constructors are called when you create a new instance of the class, while the ˜QTPlgAccessKey class destructor, is called automatically when the class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. A QTPlgAccessKey object is valid if the and properties are both different from empty strings. As, when creating an instance of this class by using the , neither the property nor the property are set to some value, then the class property will be set to false; this being the case, it is lecit to continue to use the class. Though, the class instance should be valid when using the or class methods, otherwise any call to them will fail.

The class provides you with the following initializer methods:
()
This is the default constructor. The and properties are both set to empty strings; the property is set to true. shows how to create a new access key using the default constructor, set its properties and, finally, register it
none
(other as QTPlgAccessKey)
This is the copy constructor. The properties of the object to be copied will be used to initialize the new class instance properties
none

specifies the access key type of the key to be registered. The string can not exceed 256 characters
specifies the access key value of the key to be registered.
specifies if the access key is a system access key or it is an application access key. System access keys will be displayed into the the Media Keys dialog of the QuickTime preference panel.


dim ak as new QTPlgAccessKey()
if ak<>nil then

ak.key="keytest"
ak.value="mykeyfortest"
/*
supposing the existence of a CheckBox control holding the value of the property
*/
ak.systemScope=CheckBox1.value
ak.Add()
if ak.qtPlgErr<>0 then msgbox str(ak.qtPlgErr)

end if