TBApiGetSettingDWORD API Call

 

Description

Returns a DWORD value from the registry in the UPDD branch.

Parameters

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

Returns

0 = fail, 1 = OK.

Notes

This will retrieve a DWORD value from the UPDD branch of the registry. Supply a valid Device handle (using TBApiGetRelativeDevice or TBApiGetNamedDevice) to retrieve items for a specific device or pass zero to retrieve values from the bundle branch.

See also

Other registry related API calls to set and retrieve registry entries.

 

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;

 

TBApiGetSettingDWORD(dev,_T("Enabled"),&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)

TBApiApply