TBApiGetSettingDWORD API Call



Returns a DWORD value from the general and device sections of the settings file.


Device handle (see notes), settings key name and pointer for storing returned value.


0 = fail, 1 = OK.


This will retrieve a DWORD value from the settings. Supply a valid Device handle to retrieve items for a specific device from the device section or pass zero to retrieve values from the general driver section

See also

Other settings related API calls to set and retrieve updd setting.


Visual C++ Declaration/example


BOOL TBApiGetSettingDWORD(HTBDEVICE aHandle,const TCHAR* aName, unsigned long* val);



// Flip the 'enabled' state of the driver


int dev = TBApiGetRelativeDevice(0);
DWORD bEnabled;


TBApiSetSettingDWORD(dev,_T("Enabled"),bEnabled ^ 1); 
TBApiApply();   // apply the change



Visual Basic Declaration/example


Public Declare Function TBApiGetSettingDWORD Lib "TBapi" Alias "_DLL_TBApiGetSettingDWORD@12" (ByVal aHandle As Byte, ByVal aName As String, ByVal val As Long) As Long


‘ Flip the ‘enabled’ state of the driver

Dim DeviceId As Byte

Dim result As Long

Dim addrl As Long

addrl = VarPtr(l)


DeviceId = TBApiGetRelativeDevice(0)

result = TBApiGetSettingDWORD(DeviceId, "Enabled", addrl)

result = TBApiSetSettingDWORD(DeviceId, "Enabled", 1 - l)