DocSetProtectionFlags sets the password, the comment and the protection flag.
Return Value
If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0).
Parameters
Identifies the document.
The flags PROTECT_READ and PROTECT_WRITE can be OR’d. PROTECT_READ|PROTECT_WRITE protects the document against opening and modifying.
| value | meaning |
|---|---|
| PROTECT_NONE (0) | No Protection. |
| PROTECT_READ (1) | File open protection. UniPlot requires the user to enter a password to open the document. |
| PROTECT_WRITE (2) | File modify protection. |
ssPassword is the password. The password is case sensitive. The password can be an empty string.
ssComment is a comment. The comment is displayed during opening the document.
Example
hDocTemplate = DocCreate(GetRootDirectory() + "/template/tpl_ger.ipw", 3);
hDocNew = DocCreate();
DocCopyPage(hDocTemplate, 4, hDocNew);
DocSetProtectionFlags(hDocNew, PROTECT_READ, "hallo", "hallo");
DocSave(hDocNew, "d:/test.ipw");
DocDestroy(hDocTemplate);
DocDestroy(hDocNew);
hDoc = DocCreate("d:/test.ipw", 0, "hallo");
Comment
UniPlot does not encrypt the document. Therefore this command does not provide a high degree of protection.
See also
id-520023