Sample Applications A-21
' Save Changes to the Scanner Configuration which builds a
' new Ultra.cfg
Scanner.CommitChanges()
lblStatus.Text = "" ' Initialize Status Field
txtScanData.Text = "" ' Initialize Barcode Data field
txtScanType.Text = "" ' Initialize Barcode Type Field
txtScanLength.Text = "" ' Initialize Barcode Length field
txtScanData.Focus() ' Set focus to Scan Data field
Cursor.Current = Cursors.Default
' Change Cursor Back to Default
lblStatus.Text = "Ready" ' Inform user it is ready
Me.Refresh() ' Refresh the Screen
End Sub
End Class
Public Class MyMessageWindow
Inherits Microsoft.WindowsCE.Forms.MessageWindow
' Message IDs received from scanner
Public Const SM_SCANCHAR As Integer = &H3000
' incomming scanner char message
Public Const SM_SCANSTATUS As Integer = &H3001
' incomming scanner status message
Public count As Integer = 0 ' initialize count
Public Const STR_SCANMSG As String = "Paxar Scanner
Interface"
Public strScanData As String
' Class based variables
Public unScanMsgID As Integer
' Message ID to use for broadcast
Public objForm As Form1
<DllImport("coredll", SetLastError:=True)> _
Public Shared Function RegisterWindowMessage(ByVal
lpMessage As String) As Integer
End Function
Public Sub SetForm(ByVal myForm As Form1)
objForm = myForm
unScanMsgID = RegisterWindowMessage(STR_SCANMSG)
End Sub