In the Form_Load function of the .Net form, use the Init4 method to initialize WiT Engine, and the SetDisplayWnd method to map each .Net Picture Box object to a WiT display name (the name is ‘image’ in this example). Any WiT pop-up window which matches this name will be re-directed to the .Net Picture Box object. Use the Load method to load the ‘simple’ WIC:
[C#]
public void Form1_Load(object sender, System.EventArgs e)
{
withandle = WiT.engine.Init4(this.Handle, 0, null, null, null, null);
WiT.engine.SetDisplayWnd("image", pictureBox1.Handle);
string wicName = Environment.GetEnvironmentVariable("WITHOME") +
"\\demoPrograms\\engine\\wic\\simple";
exehandle = WiT.engine.Load(wicName);
}
[Visual Basic]
Public Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
withandle = WiT.engine.Init4(Me.Handle, 0, Nothing, Nothing, _
Nothing, Nothing)
WiT.engine.SetDisplayWnd("image", PictureBox1.Handle)
Dim wicName As String = Environment.GetEnvironmentVariable("WITHOME")_
+ "\\demoPrograms\\engine\\wic\\simple"
exehandle = WiT.engine.Load(wicName)
End Sub