TBApiGetRecentToolbarButton API Call



Gets the number of the last button pressed in a toolbar, and a relative time (tick) at which the touch or click occurred.


Device Handle, toolbar name, first button number, last button number, pointer for storing last button number pressed and pointer for storing the relative time.


0 = fail, 1 = OK.


1.        You should always check the tick value, a value of zero means NO press has occurred.

2.        Buttons numbers are zero based.


Visual C++ Declaration/example


BOOL TBAPI TBApiGetRecentToolbarButton(HTBDEVICE aDeviceHandle,const TCHAR* aToolbarName, unsigned short aFirstButton, unsigned short aLastButton, unsigned short* aButton, unsigned long* aTick);


// To get the "current" button in device 1, toolbar "Toolbar" in the group of buttons 2 7:


unsigned short button;

unsigned long tick;



Visual Basic Declaration/example


Public Declare Function TBApiGetRecentToolbarButton Lib "TBapi" Alias "_DLL_TBApiGetRecentToolbarButton@24" (ByVal aDeviceHandle As Byte, ByVal aToolbarName As String, ByVal aFirstButton As Integer, ByVal aLastButton As Integer, ByVal aButton As Long, ByVal aTick As Long) As Long


To get the "current" button in device 1, toolbar "Toolbar" in the group of buttons 2 7:


Dim button As Byte

Dim tick As Long

Dim addrbutton As Long

Dim addrtick As Long

addrbutton = VarPtr(button)

addrtick = VarPtr(tick)


TBApiGetRecentToolbarButton 1, "Toolbar", 2, 7, addrbutton, addrtick