checkConnectedPad

Declaration

Delphi

function checkConnectedPad(Certificate: ShortString; AutostartSerching, showConnectionWinIfAutostart, ReadAndSaveInRegistry: Boolean; var Padsettings: ShortString): Boolean;

C/C++

BOOL SOPAD_checkConnectedPad(const char* szCertificate, BOOL bAutostartSearching, BOOL bShowConnectionWinIfAutostart, BOOL bReadAndSaveInRegistry, char szPadSettings[SOPAD_MAX_STRING_LENGTH]);

ActiveX

HRESULT checkConnectedPad([in] BSTR Certificate, [in] VARIANT_BOOL AutostartSerching, [in] VARIANT_BOOL showConnectionWinIfAutostart, [in] VARIANT_BOOL ReadAndSaveInRegistry, [in, out] BSTR* Padsettings, [out, retval] VARIANT_BOOL* Value);

Description

checkConnectedPad replaces isPadavAvailable in OCX and is new in sopad.dll.

Arguments

Certificate

contains the certificate that has formerly been given to setPadsetting. Currently it is obsolete, replaced by XML certificate.

AutostartSerching

If set to true the checkConnectedPad starts automatically to search for another signature device if the configured signature device was not found or if no signature device has been configured at all.

showConnectionWinIfAutostart obsolete

If set to true the user will see the dialog "Please connect your Signatur device now" from the driver window before it will start to search a new signature device

ReadAndSaveInRegistry

If set to true checkConnectedPad reads the padsetting from the registry and saves new padsettings to registry if it is neccessary to search for a new signature device. If no configuration is stored in registry the function uses the configuration from padsettings if given.

Padsettings

Contains the PadSettings string as formerly given to setPadsettings. If it is necessary to search for a new pad checkConnectedPad will return the new settings in this variable (also if ReadAndSaveInRegistry is set to true). If ReadAndSaveInRegistry is set to true you can always handle an empty string to padsettings.

Return value

checkConnectedPad returns true if the configured signature device is available or if a new device has been found.

 

Combinations

here are some combinations between the parameters and the status of the connected device. With the BLIND-SEARCH Driver-Option, you can hide the search dialog, if multiple devices are connected the first which is found will be automatically selected. 

AutostartSerchingReadAndSaveInRegistryPadsettingsPad is ConnectedReturn Value of checkConnectedPad 
true

true

Registry value: empty

emptyYes

true

(first found pad is being used)

true

true

Registry value: empty

emptyNofalse
true

true

Connected Pad

is stored in Registry

emptyYestrue
true

true

Different Pad

is stored in Registry

emptyYes

false

(because the stored Pad from Registry is not connected)

true-

PadSettings from

connected Pad

Yestrue
true-

PadSettings from

connected Pad

Nofalse
true

true

Connected Pad

is stored in Registry


PadSettings from

disconnected Pad

Yes

false

(Padsettings has higher priority than ReadAndSaveInRegistry)

falsetrueempty Yes

false

(with BLIND-SEARCH return value is true)

 

falsefalseempty No

false

 

false 

true

 

 
empty  Yes 

 false

(because stored Pad is not found and not AutoStartSearch is false)

false -

PadSettings from

connected Pad

Yestrue
false -

PadSettings from

disconnected Pad

Yes

 false

(because PadSettings Pad is not found and not AutoStartSearch is false)

 

Sample

C#
If (noVisiableSearchDialog)
{
	//  Disable Search Dialog for checkConnectedPad
	const int DRIVER_OPTION1_BLIND_SEARCH_IN_CHECKPAD = 0x00000020;
	SigDev.SetDriverLong(0, SigDev.GetDriverLong(0) | DRIVER_OPTION1_BLIND_SEARCH_IN_CHECKPAD);
 
	//  Disable Tablet (PEN/Touch) and Mouse devices
	SigDev.SetDriverLong(59,1);
	SigDev.SetDriverLong(60,1);
	SigDev.SetDriverLong(61,1);
}
            
SigDev.checkConnectedPad("", true, true, true, ref padsetting);
VB.NET
If (noVisiableSearchDialog =  true)
{
	//  Disable Search Dialog for checkConnectedPad
	Const DRIVER_OPTION1_BLIND_SEARCH_IN_CHECKPAD As Integer = &H20
	SigDev.SetDriverLong(DRIVER_OPTION1, SigDev.GetDriverLong(DRIVER_OPTION1) Or DRIVER_OPTION1_BLIND_SEARCH_IN_CHECKPAD)
}
            
SigDev.checkConnectedPad("", True, True, True, padsetting)