L_TBGetPosition

#include "LtTLB.h"

L_LTTLB_API L_INT L_TBGetPosition(pToolbar, lpptPos, dwFlags )

pTOOLBARHANDLE pToolbar;

/* pointer to a toolbar handle */

LPPOINT lpptPos;

/* pointer to a structure */

L_UINT32 dwFlags;

/* position flags */

Gets the toolbar's current position.

Parameter

Description

pToolbar

Pointer to a toolbar handle.

lpptPos

Pointer to a POINT structure to be updated with the toolbar's position. The coordinates are with respect to the screen.

dwFlags

Value indicates which corner of the toolbar to get. One of the following values:

 

Value

Meaning

 

TOOLBAR_POSITION_LEFT

The x coordinate of the specified point is the left of the toolbar.

 

TOOLBAR_POSITION_RIGHT

The x coordinate of the specified point is the right of the toolbar.

 

must be combined using the bitwise OR with one of these values:

 

Value

Meaning

 

TOOLBAR_POSITION_TOP

The y coordinate of the specified point is the top of the toolbar.

 

TOOLBAR_POSITION_BOTTOM

The y coordinate of the specified point is the bottom of the toolbar.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

To set the position of the toolbar, call L_TBSetPosition.

Required DLLs and Libraries

LTTLB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_TBSetPosition.

Topics:

Getting and Setting Toolbar Characterisitcs

Example

 L_INT TBGetPositionExample( pTOOLBARHANDLE pLeadToolbar,L_INT pPostiion )
{
   L_INT nRet;
   /* check the validity of the toolbar handle */
   nRet = L_TBIsValid ( pLeadToolbar );
   if (nRet == SUCCESS  )
   {
      POINT ptPos00, ptPos01 ; 

      /* get the toolbar position */
      nRet = L_TBGetPosition ( pLeadToolbar, &ptPos00, TOOLBAR_POSITION_LEFT | TOOLBAR_POSITION_TOP ) ;
      if(nRet != SUCCESS)
         return nRet;
      nRet = L_TBGetPosition ( pLeadToolbar, &ptPos01, TOOLBAR_POSITION_RIGHT | TOOLBAR_POSITION_TOP ) ;
      if(nRet != SUCCESS)
         return nRet;

      pPostiion =  ( ptPos01.x - ptPos00.x ) ;
      return SUCCESS; 
   }
   else
      return  nRet ;

}