L_AnnGetLocked
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_AnnGetLocked(hObject, pfLocked)
HANNOBJECT hObject; |
/* handle to the annotation object*/ |
/* address of a variable to be updated */ |
Gets a value that indicates whether an object is locked. This function is available in the Document/Medical Toolkits.
Parameter |
Description |
|
hObject |
Handle to the annotation object. |
|
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
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
LTANN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Windows 95 / 98 / Me, Windows 2000 / XP.
See Also
Functions: |
L_AnnUnlock, L_AnnShowLockedIcon, L_AnnUnrealize, L_AnnRealize, L_AnnLock |
Topics |
|
|
|
|
|
|
|
|
Example
For complete sample code, refer to the Annotate example.
void TestAnnLocked(HANNOBJECT hAnnObject, HWND hWnd)
{
L_BOOL bLocked;
int nRet;
L_TCHAR L_FAR *MyKey;
L_AnnShowLockedIcon(hAnnObject, TRUE, 0);
L_AnnGetLocked(hAnnObject, &bLocked);
if (bLocked)
{
MessageBox(hWnd, TEXT("Object is locked. It will be unlocked.\n"), TEXT("Message"), MB_OK);
nRet = L_AnnUnlock(hAnnObject, MyKey, 0);
if (nRet == ERROR_ANN_LOCKED)
MessageBox(hWnd, TEXT("Object was not unlocked!"), TEXT("Warning"), MB_OK);
}
else
{
MessageBox(hWnd, TEXT("Object was not locked. It will be locked now."), TEXT("Message"), MB_OK);
nRet = L_AnnLock(hAnnObject, MyKey, 0);
if (nRet != SUCCESS)
MessageBox(hWnd, TEXT("Object could not be locked.\n"), TEXT("Warning"), MB_OK);
}
return;
}