GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / TwainOpenSource Method / TwainOpenSource(IntPtr,String) Method
A Window Handle IE: Me.Handle. In most applications you can use nothing but on Citrix and WTS, this must be a top-level window or a child of a top level window.
The name of the source to open.





In This Topic
TwainOpenSource(IntPtr,String) Method
In This Topic
Opens the source with the given name. If another source is open, closes it and attempts to open the specified source. First this method for each scanning process or to set the TWAIN state to 4 (TWAIN_SOURCE_OPEN) when the TWAIN state is 3 (TWAIN_SM_OPEN) or 2 (TWAIN_SM_LOADED) or 1 (TWAIN_PRESESSION).
Syntax
'Declaration
 
Public Overloads Function TwainOpenSource( _
   ByVal HANDLE As IntPtr, _
   ByVal SourceName As String _
) As Boolean
public bool TwainOpenSource( 
   IntPtr HANDLE,
   string SourceName
)
public function TwainOpenSource( 
    HANDLE: IntPtr;
    SourceName: String
): Boolean; 
public function TwainOpenSource( 
   HANDLE : IntPtr,
   SourceName : String
) : boolean;
public: bool TwainOpenSource( 
   IntPtr HANDLE,
   string* SourceName
) 
public:
bool TwainOpenSource( 
   IntPtr HANDLE,
   String^ SourceName
) 

Parameters

HANDLE
A Window Handle IE: Me.Handle. In most applications you can use nothing but on Citrix and WTS, this must be a top-level window or a child of a top level window.
SourceName
The name of the source to open.

Return Value

True if success, else False -> Use TwainGetLastResultCode() and TwainGetLastConditionCode() methods for diagnosing the error.
Remarks
If this returns TRUE, TWAIN is in STATE 4 (TWAIN_SOURCE_OPEN).

This method requires the Document Capture (TWAIN / WIA) component to run.

See Also