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.Â
AutostartSerching | ReadAndSaveInRegistry | Padsettings | Pad is Connected | Return Value of checkConnectedPad |
---|---|---|---|---|
true | true Registry value: empty | empty | Yes | true (first found pad is being used) |
true | true Registry value: empty | empty | No | false |
true | true Connected Pad is stored in Registry | empty | Yes | true |
true | true Different Pad is stored in Registry | empty | Yes | false (because the stored Pad from Registry is not connected) |
true | - | PadSettings from connected Pad | Yes | true |
true | - | PadSettings from connected Pad | No | false |
true | true Connected Pad is stored in Registry | PadSettings from disconnected Pad | Yes | false (Padsettings has higher priority than ReadAndSaveInRegistry) |
false | true | empty | Yes | false (with BLIND-SEARCH return value is true)  |
false | false | empty | No | false  |
false | true   | empty  | Yes |  false (because stored Pad is not found and not AutoStartSearch is false) |
false | - | PadSettings from connected Pad | Yes | true |
false | - | PadSettings from disconnected Pad | Yes |  false (because PadSettings Pad is not found and not AutoStartSearch is false) |
Â
Sample
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);
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)