VCSetToggleState


Version:

8.0.0

Description:

Directly set a toggle state

Declaration:

C/C++

extern "C" vbool WINAPI VCSetToggleState(WORD id, vbool tfForcedState);

Delphi

function VCSetToggleState(id: Word; tfForcedState: WordBool): WordBool; stdcall;

ActiveX/COM

Function SetToggleState(ByVal id As Integer, ByVal tfForcedState As Integer) As Integer

Parameters:

id - the ID of the toggle to set
tfForcedState - toggle setting
0 - Off (Unchecked)
1 - On (Checked)
2 - Restore previous state

Return Value:

The previous state of the toggle

iError Code:

0 - Success
1 - Invalid world

Notes:

Prior to v8.0.0, setting a toggle required calls to VCGetToggleState to get the toggle then, if necessary, another call to either VCToggle or VCGetToggleState to toggle or reverse it. VCSetToggleState is a direct way to set a toggle, including restoring the previous state of the toggle.

See Also:

VCGetToggleState, VCToggle, VCIsToggle