Assuming that you know the coordinates of the database (i.e., its cardNo and
LocalID), you can set its beam protection attribute like this:
Err BeamProtect (UInt16 cardNo, LocalID dbID)
{
Err err;
UInt16 dbAttr;
err = DmDatabaseInfo (cardNo, dbID, NULL, &dbAttr, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL);
if (err != errNone)
return err;
dbAttr |= dmHdrAttrCopyPrevention;
err = DmSetDatabaseInfo (cardNo, dbID, NULL, &dbAttr, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL);
return err;
}
Of course, this isn't really any kind of serious protection, because the
attribute can be turned off just as easily.
Regards,
Vesselin
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/