L_AnnGetLocked

Summary

Gets a value that indicates whether an object is locked.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetLocked(hObject, pfLocked)

Parameters

HANNOBJECT hObject

Handle to the annotation object.

L_BOOL *pfLocked

Address of a variable to be updated with a value indicating whether the object is locked or unlocked. Possible values are:

Value Meaning
TRUE The object is locked.
FALSE The object is not locked.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Only unlocked objects can be locked. If an object is already locked, it will stay locked with its original key. You must pass the same key to L_AnnUnlock to unlock the object(s).

An object must be unlocked in order to change its key in the automated mode.

Redact objects must be unlocked to be restored (unrealized). Refer to L_AnnUnrealize.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For a complete sample code, refer to the \Examples\Annotation\C\Annotate demo.

L_INT AnnGetLockedExample(HANNOBJECT hAnnObject) 
{ 
   L_BOOL   bLocked; 
   L_INT    nRet; 
   L_TCHAR* MyKey = TEXT(""); 
 
   nRet = L_AnnShowLockedIcon(hAnnObject, L_TRUE, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_AnnGetLocked(hAnnObject, &bLocked); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   if (bLocked) 
   { 
      _tprintf(_T("%s"), TEXT("Message: Object is locked. It will be unlocked.\n")); 
      nRet = L_AnnUnlock(hAnnObject, MyKey, 0); 
      if (nRet == ERROR_ANN_LOCKED) 
         _tprintf(_T("%s"), TEXT("Warning: Object was not unlocked!")); 
   } 
   else 
   { 
      _tprintf(_T("%s"), TEXT("Message: Object was not locked. It will be locked now.")); 
      nRet = L_AnnLock(hAnnObject, MyKey, 0); 
      if (nRet != SUCCESS) 
         _tprintf(_T("%s"), TEXT("Warning: Object could not be locked.\n")); 
   } 
 
   return nRet; 
} 

Help Version 22.0.2023.7.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.