mirror of
https://github.com/soukoku/ntwain.git
synced 2025-12-19 19:57:02 +08:00
Test winform integration.
This commit is contained in:
@@ -46,6 +46,7 @@ namespace WinForm32
|
||||
|
||||
var hwnd = this.Handle;
|
||||
var rc = twain.OpenDSM(hwnd);
|
||||
Application.AddMessageFilter(twain);
|
||||
Debug.WriteLine($"OpenDSM={rc}");
|
||||
}
|
||||
|
||||
@@ -54,6 +55,7 @@ namespace WinForm32
|
||||
var finalState = twain.TryStepdown(STATE.S2);
|
||||
Debug.WriteLine($"Stepdown result state={finalState}");
|
||||
|
||||
Application.RemoveMessageFilter(twain);
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
@@ -105,5 +107,10 @@ namespace WinForm32
|
||||
{
|
||||
twain.EnableSource(true, true);
|
||||
}
|
||||
|
||||
private void btnStart_Click(object sender, EventArgs e)
|
||||
{
|
||||
twain.EnableSource(true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user